import java.math.BigInteger;

public class Euler577 {
    public static String solve() {
        long N = 12345;
        BigInteger ans = BigInteger.ZERO;
        long s = 1;
        while (3 * s <= N) {
            long M = N - 3 * s + 1;
            BigInteger term = BigInteger.valueOf(s)
                    .multiply(BigInteger.valueOf(M))
                    .multiply(BigInteger.valueOf(M + 1))
                    .multiply(BigInteger.valueOf(M + 2))
                    .divide(BigInteger.valueOf(6));
            ans = ans.add(term);
            s++;
        }
        return ans.toString();
    }

    public static void main(String[] args) {
        System.out.println(solve());
    }
}
