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