import java.util.stream.LongStream; /** * Created by nullzine on 2017/01/20. */ public class Main { public static void main(String[] args){ System.out.println(LongStream.range(1,Long.parseLong(new java.util.Scanner(System.in).nextLine())+1).parallel().map(m->m%3==0&&m%5==0?4:(m%3==0||m%5==0?2:0)).sum()); } }