#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main() {
  ios::sync_with_stdio(0); cin.tie(0);
  ll n;
  cin >> n;
  ll ans = 0;
  for (ll k = 1; k*k <= n; k++) {
    if (n%k == 0 && n/k > k+1)
      ans += n/k-1;
  }
  cout << ans << endl;
}
