#include <iostream>
using namespace std;
//calculating the sum of the series
int calc_sum(int N) {
int i;
int sum = (2 * N * (N + 1) * (4 * N + 17) + 54 * N) / 6;
return sum;
}
int main() {
int N = 7;
int res = calc_sum(N);
cout << res << endl;
return 0;
}