100 #ABC193C. [ABC193C] Unexpressed

[ABC193C] Unexpressed

Score : 300300 points

Problem Statement

Given is an integer NN. How many integers between 11 and NN (inclusive) are unrepresentable as aba^b, where aa and bb are integers not less than 22?

Constraints

  • NN is an integer.
  • 1N10101 \leq N \leq 10^{10}

Input

Input is given from Standard Input in the following format:

NN

Output

Print the answer.

8
6

44 and 88 are representable as aba^b: we have 22=42^2 = 4 and 23=82^3 = 8. On the other hand, 11, 22, 33, 55, 66, and 77 are unrepresentable as aba^b using integers aa and bb not less than 22, so the answer is 66.

100000
99634