CF BUDDY
← Problems·

665F · Four Divisors

2400 · data structures, dp, math

Problem: 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: The only line contains integer n (1 ≤ n ≤ 1011) — the parameter from the problem statement.

Output Format: Print the only integer c — the number of integers between 1 and n with exactly four divisors.

Sample Cases

Case 1

Input

10

Output

3

Case 2

Input

20

Output

5

Similar problems

00:00:00
Loading editor…
Welcome! I'm your coding tutor for this problem. Use the chips below to reveal stored hints or get AI feedback on your code. I'll guide you step by step — never giving away the solution.

Sign in to unlock AI tutor feedback