#include <iostream>
#include <queue>
using namespace std;
#define ll long long
#define pb push_back
#define fi first
#define se second
const ll MAXN = 1e4 + 5;
const ll MOD = 1e9 + 7;
const ll INF = 1e9 + 7;
void FastIO(){
ios_base::sync_with_stdio(false);
cin.tie(NULL); cout.tie(NULL);
}
void fre(){
freopen("CAU1.inp", "r", stdin);
freopen("CAU1.out", "w", stdout);
}
ll n, check[MAXN]{}, cnt = 0;
queue<ll> q;
int main()
{
FastIO();
fre();
cin >> n;
q.push(n);
check[n] = 1;
while(!q.empty()){
ll k = q.front();
q.pop();
for(int i=1; i*i<=k; ++i)
if(k % i == 0){
ll tmp = (i - 1) * (k/i + 1);
if(check[tmp] == 0){
++cnt;
check[tmp] = 1;
q.push(tmp);
}
}
}
cout << cnt;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8cXVldWU+Cgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKI2RlZmluZSBsbCBsb25nIGxvbmcKI2RlZmluZSBwYiBwdXNoX2JhY2sKI2RlZmluZSBmaSBmaXJzdAojZGVmaW5lIHNlIHNlY29uZAoKY29uc3QgbGwgTUFYTiA9IDFlNCArIDU7CmNvbnN0IGxsIE1PRCA9IDFlOSArIDc7CmNvbnN0IGxsIElORiA9IDFlOSArIDc7Cgp2b2lkIEZhc3RJTygpewogICAgaW9zX2Jhc2U6OnN5bmNfd2l0aF9zdGRpbyhmYWxzZSk7CiAgICBjaW4udGllKE5VTEwpOyBjb3V0LnRpZShOVUxMKTsKfQoKdm9pZCBmcmUoKXsKICAgIGZyZW9wZW4oIkNBVTEuaW5wIiwgInIiLCBzdGRpbik7CiAgICBmcmVvcGVuKCJDQVUxLm91dCIsICJ3Iiwgc3Rkb3V0KTsKfQoKbGwgbiwgY2hlY2tbTUFYTl17fSwgY250ID0gMDsKcXVldWU8bGw+IHE7CgppbnQgbWFpbigpCnsKICAgIEZhc3RJTygpOwogICAgZnJlKCk7CiAgICBjaW4gPj4gbjsKICAgIHEucHVzaChuKTsKICAgIGNoZWNrW25dID0gMTsKICAgIHdoaWxlKCFxLmVtcHR5KCkpewogICAgICAgIGxsIGsgPSBxLmZyb250KCk7CiAgICAgICAgcS5wb3AoKTsKICAgICAgICBmb3IoaW50IGk9MTsgaSppPD1rOyArK2kpCiAgICAgICAgICAgIGlmKGsgJSBpID09IDApewogICAgICAgICAgICAgICAgbGwgdG1wID0gKGkgLSAxKSAqIChrL2kgKyAxKTsKICAgICAgICAgICAgICAgIGlmKGNoZWNrW3RtcF0gPT0gMCl7CiAgICAgICAgICAgICAgICAgICAgKytjbnQ7CiAgICAgICAgICAgICAgICAgICAgY2hlY2tbdG1wXSA9IDE7CiAgICAgICAgICAgICAgICAgICAgcS5wdXNoKHRtcCk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgIH0KICAgIGNvdXQgPDwgY250OwogICAgcmV0dXJuIDA7Cn0K