#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll a[5]={0,2,5,11,13}; 
int main() {
    ll n;
    while(cin>>n) {
        ll ans=n;
        for(int i=1,cnt=0;i<16;++i,cnt=0) {
            int tot=i,j=0;
            ll tmp=1;
            while(tot) {
                ++j;
                if(tot&1) {
                    ++cnt;
                    tmp*=a[j];
                }
                tot>>=1;
            }
            if(cnt&1) ans-=n/tmp;
            else ans+=n/tmp;
        }
        cout<<ans<<endl;
    }
}