#include using namespace std; int main() { long long n; cin>>n; auto a=n*(n+1)/2; auto b=(n+1)*(n+2)/2; auto res=1LL; for(auto i=2LL;i*i<=a;++i) if (a%i==0 and b%i==0) res=i; cout<