
// Problem : B. Move and Turn
// Contest : Codeforces - Codeforces Round #691 (Div. 2)
// URL : https://codeforces.com/contest/1459/problem/B
// Memory Limit : 512 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include <bits/stdc++.h>
using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    long long int n;
    cin>>n;
    vector <long long int> v(1001);
    v[1]=4;
    v[2]=4;    
    long long int inc1=8,inc2=8;
    for(long long int i=3;i<=1000;++i)
    {
    	if(i%2)
    	{
    		v[i]+=v[i-2];
    		v[i]+=inc1;
    		inc1+=4;
    	}
    	else
    	{
    		v[i]+=v[i-4];
    		v[i]+=inc2;
    		inc2+=4;    			
    	}
    }
    if(n%4==0)
    	++v[n];
    cout<<v[n];
    return 0;
}