#include int main() { unsigned long long N; scanf("%llu",&N); unsigned long long len=0; for(unsigned long long i=1;i<=N;i++) { if( !(i%15) ) len+=4; else if( !(i%3)||!(i%5) ) len+=2; } printf("%llu\n",len); return 0; }