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

#SP0000155. Số lượng ước nguyên tố phân biệt lớn nhất (Leonardo's Prime Factors)

HỌC THEO LỘ TRÌNH

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

1 lộ trình

Số lượng ước nguyên tố phân biệt lớn nhất (Leonardo's Prime Factors)

Leonardo's Prime Factors

Source: HackerRank
Version: Phuoc Hung OJ Extended — one dataset per judge run.

Problem Statement

Given nn, find the maximum possible number of distinct prime factors of any integer xx with 1≤x≤n1\le x\le n. Integer 11 has zero prime factors.

Input

One line containing the integer nn.

Output

Print the maximum count.

Subtasks

  • Subtask 1 (20 points): 1≤n≤100001\le n\le 10000.
  • Subtask 2 (30 points): 1≤n≤100000000001\le n\le 10000000000.
  • Subtask 3 (50 points): 1≤n≤10000000000000000001\le n\le 1000000000000000000.

Example

Input

500

Output

4

Explanation

The first four distinct primes have product 2⋅3⋅5⋅7=210≤5002\cdot3\cdot5\cdot7=210\le500, while multiplying by the next prime 1111 exceeds 500500; answer: 44.