#include <stdio.h>

int main()
{
    int n, j, sum = 0, flag = 0;


    while(scanf("%d", &n) == 1)
    {
        for(j = 2; j <= n; j++)
        {
            if(j % 2 == 0 && j != 2)
            {
                flag = 1;
            }
            else if(j % 3== 0 && j != 3)
            {
                flag = 1;
            }
            else if(j % 5== 0 &&  j != 5)
            {
               flag = 1;
            }
            else if(j % 7 == 0 && j != 7)
            {
               flag = 1;
            }
            if(flag == 0)
            {
                sum = sum + 1;
            }
            flag = 0;

        }
        printf("%d\n", sum);
        flag = 0;
        sum = 0;
    }
    return 0;
}