Universal Cup Judging System

Universal Cup

Limite de temps : 1.0 s Limite de mémoire : 512 MB Points totaux : 100 Hackable ✓
Statistiques

Iroha and Kaguya have recently become fascinated by a mathematical game based on integers.

Initially, they share a positive integer $n$. The two players take turns performing operations; a single round is defined as both Iroha and Kaguya completing one operation each. In each round:

  1. Iroha goes first: She must choose a non-negative integer $x$ ($0\le x<n$) and replace the current $n$ with $n+x$.

  2. Kaguya goes second: She must choose a prime number $p$ that divides the current $n$ (i.e., $p\mid n$) and replace the current $n$ with $\frac{n}{p}$.

The above operations repeat continuously. If $n=1$ after the end of any round, the game ends immediately.

During the game, Iroha aims to maximize the total number of rounds played, while Kaguya aims to minimize the total number of rounds. Assuming both players are perfectly rational and adopt optimal strategies, please determine the total number of rounds the game will ultimately last.

Input

The first line contains an integer $n$ ($1\le n\le10^{18}$), representing the initial number of the game.

Output

Output a single line containing an integer, representing the total number of rounds the game will last given that both players play optimally.

Examples

Input 1

1

Output 1

0

Input 2

9

Output 2

4

Input 3

16

Output 3

5

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.