#include <stdio.h>
#include<iostream>

using namespace std;

int n;
int a[1000000];
int ans;

int main()
{
    while(cin >> n)
    {
        for(int i = 2; i <= n; i++)
        {
            if(i == 2 || i == 3 || i == 5 || i == 7)ans++;
            if(i % 2 != 0 && i % 3 != 0 && i % 5 != 0 && i % 7 != 0)ans++;
        }
        cout << ans << endl;
        ans = 0;
    }
    return 0;
}