import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] fel = new int[]{3, 5, 17, 257, 65537}; HashSet set = new HashSet<>(); for (int i = 0; i < Math.pow(2, 6); i++) { int x = i; long value = 1; for (int j = 0; j < 5; j++) { if (x % 2 == 1) { value *= fel[j]; } x /= 2; } set.add(value); } int count = 0; for (long x : set) { while(x <= n) { if (x > 2) { count++; } x *= 2; } } System.out.println(count); } }