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 fizzBuzz = (N / 15); long fizz = (N / 3) - fizzBuzz; long buzz = (N / 5) - fizzBuzz; System.out.println(fizzBuzz * 4 + fizz * 2 + buzz * 2); } }