1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <iostream>

using namespace std;

int pin(int);

int main(void) {
	int i;
	while (cin >> i) cout << pin(i) << endl;
	return 0;
}

int pin(int n) {
	int count = 0;
	for (int a = 1; 7 * a <= n; ++a) {
		if (n%a != 0) continue;
		int nn = n / a - 1;
		for (int x = 2; x * 3 <= nn; ++x) {
			if (nn%x == 0)  ++count;
		}
	}
	return count;
}