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

#SP0000158. Đếm các số không biểu diễn được thành lũy thừa (Unexpressed)

HỌC THEO LỘ TRÌNH

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

1 lộ trình

Đếm các số không biểu diễn được thành lũy thừa (Unexpressed)

Unexpressed

Source: AtCoder ABC193 C
Version: Phuoc Hung OJ Extended — one dataset per judge run.

Problem Statement

Given NN, count integers in [1,N][1,N] that cannot be represented as aba^b for integers a≥2a\ge2 and b≥2b\ge2.

Input

One line containing the integer NN.

Output

Print the number of unexpressible integers.

Subtasks

  • Subtask 1 (20 points): 1≤N≤100001\le N\le 10000.
  • Subtask 2 (30 points): 1≤N≤100000001\le N\le 10000000.
  • Subtask 3 (50 points): 1≤N≤100000000001\le N\le 10000000000.

Example

Input

8

Output

6

Explanation

Only 4=224=2^2 and 8=238=2^3 can be expressed as nontrivial powers. The remaining six numbers are counted.