import java.util.*;
import java.util.Scanner;

public class Main {
static int m=0;
public static void main(String[] args) {

Scanner scanner = new Scanner(System.in);
while(scanner.hasNext()) {
    Integer in = Integer.parseInt(scanner.nextLine());
    m=0;
    for(int i =1;i<=in;i++) {
        if(judge(i)) {
            m++;
        }
    }
    System.out.println(m);
}

}
private static boolean judge(int i) {
boolean flag=false;
List<integer> list = new ArrayList<>();
for(int m=1;m<i;m++) {
if(i%m==0) {
list.add(m);
}
}
int sum=0;
if(list.size()!=0) {
for(Integer z:list) {
sum=sum+z;
}
if(sum==i) {
flag = true;
}
}
return flag;
}
}</integer>