import java.util.Scanner; public class Main { public static void main(String[] p) { Scanner q = new Scanner(System.in); long n = q.nextLong(); long a = 0L; for (long i = 1; i <= n; i++) { if (i % 3 == 0 || i % 5 == 0) { a += 2L; } else if (i % 15 == 0) { a += 4; } } System.out.println(a); } }