3728.Almost Prime

Time Limit: 1s Memory Limit: 256MB

A number is called almost prime if it has exactly two distinct prime divisors. For example, numbers 6, 18, 24 are almost prime, while 4, 8, 9, 42 are not. Find the amount of almost prime numbers which are between 1 and n, inclusive.

Input Format(From the terminal/stdin)

Input contains one integer number n (1 \le n \le 3000).

Output Format(To the terminal/stdout)

Output the amount of almost prime numbers between 1 and n, inclusive.

Sample Input 1

Copy
10
  \n

Sample Output 1

Copy
2
 \n

Sample Input 2

Copy
21
  \n

Sample Output 2

Copy
8
 \n

Submit

请先 登录

© 2025 FAQs