#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#define popcount __builtin_popcount
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
ll n, ans;
int main()
{
    cin>>n;
    if(n==1){
        cout<<0<<endl; return 0;
    }else if(n==2){
        cout<<4<<endl; return 0;
    }
    ans=2*n-1;
    deque<ll> deq;
    for(int i=2; i<=n; i++) deq.push_back(i);
    for(int i=0; ; i++){
        if(n%4==1 && deq.size()==4){
            ans+=deq[0]*deq[1];
            ans+=deq[0]*deq[3];
            ans+=deq[1]*deq[2];
            break;
        }else if(n%4==0 && deq.size()==3){
            ans+=deq[0]*deq[1];
            ans+=deq[0]*deq[2];
            break;
        }else if(n%4==3 && deq.size()==2){
            ans+=deq[0]*deq[1]; break;
        }else if(n%4==2 && deq.size()==3){
            ans+=deq[0]*deq[2];
            ans+=deq[1]*deq[2];
            break;
        }
        ans+=deq[0]*deq.back();
        ans+=deq[1]*deq[deq.size()-2];
        if(i&1){
            deq.pop_front();
            deq.pop_front();
        }else{
            deq.pop_back();
            deq.pop_back();
        }
    }
    cout<<ans<<endl;
    return 0;
}