// yukicoder 311 (http://yukicoder.me/problems/848) #include typedef long long ll; ll N; int main() { scanf( "%lld", &N ); ll n15 = N/15, n3 = N/3, n5 = N/5; printf( "%lld\n", n15*4+(n3-n15)*2+(n5-n15)*2 ); return 0; }