import java.util.Scanner; public class yukicoder_311 { public static void main(String[] args) { Scanner stdIn = new Scanner(System.in); long n = stdIn.nextLong(); long kosu = 0; for (long i = 1; i <= n; i++) { if ((i % 3 == 0) && (i % 5 == 0)) { kosu += 4; } else if ((i % 3 == 0) || (i % 5 == 0)) { kosu += 2; } else { } } System.out.print(kosu); } }