#include #include #include using namespace std; using ll = long long int; ll guchoku(int n){ vector arr(n); for(int i = 0; i < n; i++) arr[i] = i+1; ll ans = 1LL << 60; do{ ll res = 0; for(int i = 1; i < n; i++){ res += arr[i]*arr[i-1] + arr[i]-arr[i-1]; } res += arr[0]*arr[n-1] + arr[0]-arr[n-1]; ans = min(ans, res); // for(int i = 0; i < n; i++) cout << arr[i] << " "; // cout << res << endl; }while(next_permutation(arr.begin(), arr.end())); do{ ll res = 0; for(int i = 1; i < n; i++){ res += arr[i]*arr[i-1] + arr[i]-arr[i-1]; } res += arr[0]*arr[n-1] + arr[0]-arr[n-1]; if(res == ans){ for(int i = 0; i < n; i++) cout << arr[i] << " "; cout << res << endl; } }while(next_permutation(arr.begin(), arr.end())); return ans; } ll solve(int n){ if(n == 1) return 0; if(n == 2) return 4; if(n%2 == 1){ vector b(n/2); b[0] = 10; for(int i = 1; i < b.size(); i++){ b[i] = b[i-1] + 8*(i+1); } ll ans = 1; // for(int i = 0; i < b.size(); i++) cout << b[i] << " "; for(auto &it: b) ans += it; return ans; }else{ vector b(n/2-1); b[0] = 17; for(int i = 1; i < b.size(); i++){ b[i] = b[i-1] + 8*i+12; } ll ans = 4; // for(int i = 0; i < b.size(); i++) cout << b[i] << " "; for(auto &it: b) ans += it; return ans; } } int main(){ int n; cin >> n; cout << solve(n) << endl; // cout << guchoku(n) << endl; return 0; }