PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#SP0000184. Số giống 250 (250-like Number)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Số giống 250 (250-like Number)

250-like Number

Source: AtCoder ABC250 D — https://atcoder.jp/contests/abc250/tasks/abc250_d
Edition: Phuoc Hung OJ Extended; one dataset per program run. Subtasks are authored for PHOJ, not claimed to be official.

Problem

Count the positive integers k≤Nk\le N expressible as k=pq3k=pq^3 with primes p<qp<q. Distinct pairs yield distinct integers by unique prime factorization.

Input

One integer NN.

Output

Output the count.

Subtasks

  • Subtask 1 (20 points): 1≤N≤1061\le N\le10^6.
  • Subtask 2 (30 points): 1≤N≤10121\le N\le10^{12}.
  • Subtask 3 (50 points): 1≤N≤10181\le N\le10^{18}.

Example

Input

250

Output

2

Explanation

The qualifying numbers not exceeding 250250 are 54=2⋅3354=2\cdot3^3 and 250=2⋅53250=2\cdot5^3.