//https://ncode.syosetu.com/n4830bu/276/ #include using namespace std; int main() { long long N; cin >> N; cout << gcd(N * (N + 1) / 2, N) << endl; }