#abc300d. D - AABCC

D - AABCC

Score : 400400 points

问题陈述

有多少不大于 NN 的正整数可以表示为 a2×b×c2a^2 \times b \times c^2 形式,其中 aabbcc 是三个 质数 ,且满足 a<b<ca<b<c

以上为通义千问 qwen-max 翻译,仅供参考。

Problem Statement

How many positive integers no greater than NN can be represented as a2×b×c2a^2 \times b \times c^2 with three primes a,ba,b, and cc such that a<b<ca<b<c?

Constraints

  • NN is an integer satisfying 300N1012300 \le N \le 10^{12}.

Input

The input is given from Standard Input in the following format:

NN

Output

Print the answer as an integer.

Sample Input 1

1000

Sample Output 1

3

The conforming integers no greater than 10001000 are the following three.

  • 300=22×3×52300 = 2^2 \times 3 \times 5^2
  • 588=22×3×72588 = 2^2 \times 3 \times 7^2
  • 980=22×5×72980 = 2^2 \times 5 \times 7^2

Sample Input 2

1000000000000

Sample Output 2

2817785

update @ 2024/3/10 08:24:17