#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define mp make_pair #define mt make_tuple #define pb push_back #define rep(i,n) for(int i=0;i<(n);i++) using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair pii; const int INF=1<<29; const double EPS=1e-9; const int dx[]={1,0,-1,0},dy[]={0,-1,0,1}; ll n; ll calc(ll x){ ll res = 1; for (ll i = 2; i * i <= x; i++){ if (x % i == 0){ res += i; } if (i * i != x){ res += x / i; } } return res; } int main(){ cin >> n; if (n % 2 == 0){ n = n / 2; } cout << calc(n) << endl; }