1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include<cstdio>
#include<math.h>
using namespace std;

long long n,wyn;

void count(long long x)
{
	x--;
	int a=sqrt(x);
	for(int i=2;i<=a;i++)if(x%i==0)
	{
		if(x/i>2)wyn++;
		if(x/i>1&&i>2&&i!=x/i)wyn++;
	}
}

int main ()
{
	scanf("%lld",&n);
	int a=sqrt(n);
	for(int i=1;i<=a;i++)if(n%i==0)
	{
		count(i);
		if(i!=n/i)count(n/i);
	}
	printf("%lld",wyn);
}