#include
using namespace std;
#define ll long long
int main() {
// cout<<“Hello World!”;
ll arrary[]={2,3,5,7,11,13,17,19};
ll noOfSetBit=(1<<8) -1;
ll n;
cin>>n;
ll ans=0;
for(ll i=1;i<=noOfSetBit;i++){
ll denominator=1ll;
ll countSetBits=__builtin_popcount(i);
for(int j=0;j<8;j++){
if(i&(1<<j)){
denominator=denominator*arrary[j];
}
}
if(noOfSetBit&1){
ans+=(n/denominator);
}else{
ans-=(n/denominator);
}
}
cout<<ans<<endl;
}