#include<stdio.h>
#include<math.h>
int main()
{
    int n, i, j, count=0, m, divisors=2;
    scanf("%d", &n);
    if(n<105) printf("0\n");
    else
    {
        m=sqrt(n);
        for(i=105; i<=n; i++)
        {
            for(j=3; j<=m; j++)
            {
                if((n%j)==0) divisors+=2;
            }
            if(divisors==8) count++;
        }
        printf("%d\n", count);
    }
    return 0;
}
