101932: [AtCoder]ABC193 C - Unexpressed

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Score : $300$ points

Problem Statement

Given is an integer $N$. How many integers between $1$ and $N$ (inclusive) are unrepresentable as $a^b$, where $a$ and $b$ are integers not less than $2$?

Constraints

  • $N$ is an integer.
  • $1 ≤ N ≤ 10^{10}$

Input

Input is given from Standard Input in the following format:

$N$

Output

Print the answer.


Sample Input 1

8

Sample Output 1

6

$4$ and $8$ are representable as $a^b$: we have $2^2 = 4$ and $2^3 = 8$.
On the other hand, $1$, $2$, $3$, $5$, $6$, and $7$ are unrepresentable as $a^b$ using integers $a$ and $b$ not less than $2$, so the answer is $6$.


Sample Input 2

100000

Sample Output 2

99634

Input

题意翻译

# [ABC193C] Unexpressed ## 题目描述 [problemUrl]: https://atcoder.jp/contests/abc193/tasks/abc193_c 给出一个整数 $n$,输出在 1~ $n$ 之间的所有整数中,有多少个不能被 $a^{b} \left(a \ge 2 \And b \ge 2 \right)$ 表示的数。 ## 输入格式 输入一个整数 $n$。 ## 输出格式 输出在 1~ $n$ 之间的所有整数中,有多少个不能被 $a^{b} \left(a \ge 2 \And b \ge 2 \right)$ 表示的数。 ## 样例 #1 ### 样例输入 #1 ``` 8 ``` ### 样例输出 #1 ``` 6 ``` ## 样例 #2 ### 样例输入 #2 ``` 100000 ``` ### 样例输出 #2 ``` 99634 ``` ## 提示 ### 制约 - $n$ 是一个整数 - $ 1 \le n \le 10^{10}$ ### 样例1说明 只有 4 , 8 能被 $a^{b} \left(a \ge 2 \And b \ge 2 \right)$ 表示,$4=2^{2}$,$8=2^{3}$。

加入题单

算法标签: