import java.util.Scanner; public class Main { public static void main(String[] args) { // write your code here Scanner s = new Scanner(System.in); long count = 0; long N = s.nextLong(); count = 4 * N / 15 + 2 * (N / 3 + N / 5 - 2 * N / 15); System.out.println(count); } }