import java.util.Scanner;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int count=0;
        for (int i = 2; i <= n; i++) {
            if(check(i)){
                count++;
            }
        }
        System.out.println(count);
    }
    private static boolean check(int n){
        int sum=1;
        for (int i = 2; i <= Math.sqrt(n); i++) {
            if(n%i==0){
                if(i==Math.sqrt(n)){
                    sum+=i;
                }else {
                    sum += i + (n / i);
                }
            }
        }
        if(sum!=n){
            return false;
        }
        return true;
    }
}