import java.util.Scanner; public class Main_yukicoder237 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); long[] num = {2, 4, 16, 256, 65536, 3, 5, 17, 257, 65537}; int ret = 0; for (int i = 1; i < 1 << num.length; i++) { long tmp = 1; for (int j = 0; j < num.length; j++) { if ((i & (0x1 << j)) != 0) { tmp *= num[j]; } } if (tmp <= a) { ret++; } } System.out.println(ret - 1); sc.close(); } }