#include <stdio.h> main() { int a; scanf("%d",&a); printf("%d",hea(a)); getchar(); } int hea(int a) { int b,gs=0; for(b=1;b<=a;b++) if(b%3==0 && b%10==5) gs++; return gs; }