#include int main(void) { // Initialize variables and get input long long sum = 0; long long n; scanf("%lld", &n); // if n is smaller than 3 if (n < 3) { printf("0\n"); return 0; } // Iterate through all for (long long i = 3; i <= n; i++) { sum += i * (i - 1) * (i - 2); } // Print the result printf("%lld\n", sum); return 0; }