package yukicoder; import java.util.Scanner; public class N311 { public static void main(String[] args){ Scanner sc = new Scanner(System.in); long n = sc.nextLong(); long a = n / 15; long b = n / 3; long c = n / 5; System.out.println((b+c) * 2 + (a - (c/3)) * 4); } }