#include <iostream>
using namespace std;
int main()
{
long long m;
while(cin>>m)
{
if(m%4==1||m==2)
cout<<m<<endl;
else
cout<<2*m*m<<endl;
}
return 0;
}
#include <iostream>
using namespace std;
int main()
{
long long m;
while(cin>>m)
{
if(m%4==1||m==2)
cout<<m<<endl;
else
cout<<2*m*m<<endl;
}
return 0;
}