#include using namespace std; signed main(){ int N; cin >> N; cout << __gcd( 1LL * N, 1LL * N * ( N + 1 ) / 2 ) << endl; return 0; }