import java.util.*;
public class show
{
public static void main(String args[])
{
Scanner input=new Scanner(System.in);
int N;
int number=0;
//System.out.println("请输入N：");
N=input.nextInt();
for(int i=1;i<=N;i++)
{
if(i % 2!=0)
{
if(i % 3 !=0)
{
if(i % 5!=0)
{
if(i % 7 !=0)
{
number++;
}
}
}
}
}
System.out.println(number);
}
}

#include

#include

#include

#include

#include

#include

#pragma warning(disable:4996)

using namespace std;

int main()

{

cin>>n;

``````num=0;

a=n/2;
b=n/3;
c=n/5;
d=n/7;

ab=n/6;
ac=n/10;
bc=n/15;
bd=n/21;
cd=n/35;

abc=n/30;
abd=n/42;
acd=n/70;
bcd=n/105;

abcd=n/210;

cout<<n-num<<endl;
return 0;
``````

}

import java.util.*;
public class show
{
public static void main(String args[])
{
Scanner input=new Scanner(System.in);
long N;
long sum=0;
//System.out.println("请输入N：");
N=input.nextInt();
//sum=(N/a)+(N/b)+(N/c)+(N/d)-(N/a/b)-(N/a/c)-(N/a/d)-(N/b/c)-(N/b/d)-(N/c/d)+(N/a/b/c)+(N/a/b/d)+(N/a/c/d)+(N/b/c/d)-(N/a/b/c/d);
a=N/2;
b=N/3;
c=N/5;
d=N/7;
ab=N/6;
ac=N/10;
bc=N/15;
bd=N/21;
cd=N/35;
abc=N/30;
abd=N/42;
acd=N/70;
bcd=N/105;
abcd=N/210;