#include <stdio.h>
#include <string.h>
#include <math.h>
//参考素数的计算吧,主要是用sqrt n减少循环次数
int is_total_num(int n);
int main()
{
int n;
int count;
while (scanf("%d", &n) != EOF)
{
count = 0;
for (int j = 2; j <= n; j++)
{
if (is_total_num(j))
count++;
}
printf("%d\n", count);
}
return 0;
}
int is_total_num(int n)
{
int ret = 0;
for (int i = 2; i <= sqrt(n); i++)
{
if (n%i == 0)
{
ret += i;
if (n / i != i)
ret += n / i;
}
}
//加上因子1
ret++;
if (ret != n)
ret = 0;
return ret;
}