#include int main(){ unsigned long int N; unsigned long int a,b,c; unsigned long int ans; scanf("%lu",&N); a=N/3;b=N/5;c=N/15; ans = ((a-c)+(b-c)+c*2)*2; printf("%lu\n",ans); return 0; }