import java.util.Scanner; public class No311 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long N = sc.nextLong(); long sum = 0; long x; x = N/15 * 4; sum += (N/3 - x)*2; sum += (N/5 - x)*2; sum += x * 4; System.out.println(sum); } }