#include #include #include #include #include #include #include #include #include #define repd(i,a,b) for (int i=(a);i<(b);i++) #define rep(i,n) repd(i,0,n) typedef long long ll; using namespace std; int inputValue(){ int a; cin >> a; return a; }; void inputArray(int * p, int a){ rep(i, a){ cin >> p[i]; } }; void inputVector(vector * p, int a){ rep(i, a){ int input; cin >> input; p -> push_back(input); } } template void output(T a, int precision) { if(precision > 0){ cout << setprecision(precision) << a << "\n"; } else{ cout << a << "\n"; } } // a < b ll gcd(ll a, ll b){ ll c = b % a; if (c == 0) { return a; } else if (c == 1){ return 1; } else{ return gcd(c, a); } } int main(int argc, const char * argv[]) { // source code ll N; cin >> N; ll S = N * (N + 1) / 2; output(gcd(N, S), 0); return 0; }