#include <iostream> #include <vector> #include <cstdio> #include <cmath> #include <set> #include <map> #include <string> using namespace std; int main() { //printf("%d\n", 1<<30); int n; char s[100000]; while(scanf("%s", s) == 1) { //printf("%s\n", s); char *t = s+2; //printf("%s\n", t); sscanf(t, "%d", &n); //printf("%d\n", n); int x, y; int count = 0; for(x=n+1; x*x <= n*2*x; x++) { /*for(y=x; ; y++) { if(x*y == n*(x+y)) { count++; break; } else if(x*y > n*(x+y)) { break; } }*/ y = n*x/(x-n); if(x <= y && x*y == n*(x+y)) count++; } printf("%d\n", count); } return 0; }