#include int main(void){ long long int i,a,c; scanf("%lld",&a); for(i=1;i<=a;i++){ if(i%15 == 0) c += 4; else if(i%3 == 0) c += 2; else if(i%5 == 0) c += 2; } printf("%lld\n",c); return 0; }