import java.util.Date; import java.util.Scanner; public class Main{ public static void main(String[] args){ long exec_time=new Date().getTime(); Scanner sc=new Scanner(System.in); long n=sc.nextLong(); int ans=0; for(long i=1;i<=n;i++){ if(i%3==0&&i%5==0){ ans+=4; }else if(i%3==0){ ans+=2; }else if(i%5==0){ ans+=2; } } System.out.println(ans); System.err.println(new Date().getTime()-exec_time+"ans"); } }