// Arup Guha
// 6/18/2023
// Solution to SIUCF CP Final Contest Problem: Fractional Lotion
// https://open.kattis.com/problems/fractionallotion

using namespace std;
#include <bits/stdc++.h>

int main() {

    string s;

    while (cin >> s) {

        // Get rid of the first 2 chars, convert to int.
        s = s.substr(2, s.size()-2);
        int den = stoi(s);

        int res = 0;

        // One of the two fractions has to be greater than or equal to
        // 1/(2*d), so we can just search this whole space.
        for (int i=den+1; i<=2*den; i++)
            if ( (den*i)%(i-den) == 0)
                res++;

        // Ta da!
        cout << res << "\n";
    }

    return 0;
}
