#include<bits/stdc++.h>
using namespace std;
int p[30]={0},k;
int find()
{
int n=0;
int end=0,i=1+k;//m>=k+1
while(!end){
int location=0,judge=0;
for(int j=1;j<=k;j++)p[j]=1;
for(int j=k+1;j<=2*k;j++)p[j]=0;
while(n<k){
location=(location+n)%(2*k-n);
p[location]=-1;
++n;
}
for(int j=1;j<=k;j++){
if(p[j]!=1){
judge=1;
break;
}
}
if(!judge){
end=1;
return i;
}
else ++i;
}
return -1;
}
int main()
{
scanf("%d",&k);
printf("%d",find());
return 0;
}
/*
111000
11100
1110
111
*/