#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define mp make_pair
#define F first
#define S second

signed main(){
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	int n;
	int x=0;
	cin >> n;
	int a = n+1;
	if(n==1 || n==2){
		cout << 4;
	}
	else if(n%2==0){
		if(n%4==0){		
			for(int i=1; i<=n+1; i+=4){
				x += 2*i-2;
			}
			x++;
			cout << x;
		}
		else{
			for(int i=3; i<=n+1; i+=4){
				x += 2*i-2;
			}
			cout << x;
		}
	}
	else{
		a=n+2;
		cout << a*a/2;
	}




	
	

	return 0;
}