#include <iostream>
using namespace std;
int main() {
unsigned n, q = 0;
cin >> n;
for (int i = 1; i <= n; i++)
if (n / i == n % i) q += 1;
cout << q;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7Cgl1bnNpZ25lZCBuLCBxID0gMDsKCWNpbiA+PiBuOwoJZm9yIChpbnQgaSA9IDE7IGkgPD0gbjsgaSsrKQoJCWlmIChuIC8gaSA9PSBuICUgaSkgcSArPSAxOwoJY291dCA8PCBxOwoJcmV0dXJuIDA7Cn0=