2354.Four Divisors

Time Limit: 1s Memory Limit: 256MB

If an integer a is divisible by another integer b, then b is called the divisor of a.

For example: 12 has positive 6 divisors. They are 1, 2, 3, 4, 6 and 12.

Let’s define a function D(n) - number of integers between 1 and n (inclusive) which has exactly four positive divisors.

Between 1 and 10 only the integers 6, 8 and 10 has exactly four positive divisors. So, D(10)=3.

You are given an integer n. You have to calculate D(n).

Input Format(From the terminal/stdin)

The only line contains integer n (1 \le n \le 1011) - the parameter from the problem statement.

Output Format(To the terminal/stdout)

Print the only integer c - the number of integers between 1 and n with exactly four divisors.

Sample Input 1

Copy
10
  \n

Sample Output 1

Copy
3
 \n

Sample Input 2

Copy
20
  \n

Sample Output 2

Copy
5
 \n

Submit

请先 登录

© 2025 FAQs