import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import static java.lang.System.in; public class Main { public static void main(String[] args) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(in)); long N = Long.parseLong(reader.readLine()); long counter = 0; for (long i = 3; i <= N; i++) { if (i % 15 == 0) { counter += 4; } else if (i % 5 == 0) { counter += 2; } else if (i % 3 == 0) { counter += 2; } } System.out.println(counter); } }