import java.util.Scanner;
public class Main
{
public static void main(String[] args)
{
Scanner cin = new Scanner(System.in);
int N = cin.nextInt();
int OUT = count(N);
System.out.println(OUT);
cin.close();
}
private static int count(int n) {
// TODO Auto-generated method stub
int result = 0;
for (int i = 2; i <= n; ++i)
{
int sum = 1;
for (int j = 2; j <= Math.sqrt(i); ++j)
{
if (i % j == 0)
{
sum += j;
sum += i / j;
}
}
if (sum == i) ++result;
}
return result;
}
}
public class Main
{
public static void main(String[] args)
{
Scanner cin = new Scanner(System.in);
int N = cin.nextInt();
int OUT = count(N);
System.out.println(OUT);
cin.close();
}
private static int count(int n) {
// TODO Auto-generated method stub
int result = 0;
for (int i = 2; i <= n; ++i)
{
int sum = 1;
for (int j = 2; j <= Math.sqrt(i); ++j)
{
if (i % j == 0)
{
sum += j;
sum += i / j;
}
}
if (sum == i) ++result;
}
return result;
}
}