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 (long l = 1; l <= endNum; l++) { if (l % 15 == 0) { z_count += 4; } else if (l % 5 == 0 || l % 3 == 0) { z_count += 2; } } System.out.println(z_count); sc.close(); } }