#include <cstdio> #include <vector> #include <iostream> #include <string> #include <algorithm> #include <cstring> using namespace std; int E(int a, int b) { if (b==0) { return a; } else { return E(b, a%b); } } int main() { int n, pocet=0; while (scanf("1/%d\n", &n) > 0) { pocet = 0; //cout << n << endl; for (int x=0; x<1000000; x++) { if ((x-n > 0) && (x <= (x*n)/(x-n)) && (E(n*x, x-n) == x-n)) { //cout << "added " << x << " for " << n << endl; pocet++; } } printf("%d\n", pocet); } return 0; }