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

#SP0000169. Đếm số không chứa bình phương (Square-free Integers)

HỌC THEO LỘ TRÌNH

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

1 lộ trình

Đếm số không chứa bình phương (Square-free Integers)

Square-free Integers

Phuoc Hung OJ problem: PRIME000174
Reference: SPOJ SQFREE
Adaptation: one original query per PHOJ execution; subtasks are PHOJ-specific groups.

Problem statement

A positive integer is square-free if it is not divisible by d2d^2 for any integer d>1d>1. Given nn, count positive square-free integers not exceeding nn.

Input

One positive integer nn. (PHOJ version: one query per execution.)

Output

Print the required count.

Subtasks

  • Subtask 1 (20 points): 1≤n≤1051\le n\le10^5.
  • Subtask 2 (30 points): 105<n≤10910^5<n\le10^9.
  • Subtask 3 (50 points): 109<n≤101410^9<n\le10^{14}.

Example

Input

1000

Output

608

Explanation: Exactly 608608 integers in [1,1000][1,1000] are not divisible by any square larger than one; 11 is included.