#include using namespace std; long long gcd(int x,long long y){ if((x == 0) || (y == 0)) return 0; while(x != y){ if(x > y) x -= y; else y -= x; } return x; } int main(){ int n; cin >> n; cout << gcd(n,(n - 1) * n / 2) << endl; }