import java.util.*; public class Exercise37{ public static void main (String[] args){ Scanner sc = new Scanner(System.in); int num = sc.nextInt(); int count = 0; for (int n = 1; n <= num; n++){ if (n % 3 == 0 && n % 5 == 0){ count += 4; }else if(n % 3 == 0){ count += 2; }else if(n % 5 == 0){ count += 2; } } System.out.println(count); } }