import java.util.Scanner; public class No_311 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long endNum = sc.nextLong(); long z_count = 0; for (int i = 1; i <= endNum; i++) { if (i % 15 == 0) { z_count += 4; } else if (i % 5 == 0 || i % 3 == 0) { z_count += 2; } } System.out.println(z_count); sc.close(); } }