import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main{ public static void main(String[] args) { try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) { long n = Long.parseLong(br.readLine()); long FizzBuzz = (n / 15); long Fizz = (n / 3) - FizzBuzz; long Buzz = (n / 5) - FizzBuzz; long cnt = FizzBuzz * 4 + Fizz * 2 + Buzz *2; System.out.println(cnt); } catch (IOException e) { e.printStackTrace(); } } }