logo AlgoBeat OnlineJudge
登录 注册

#217720. [ICPC 2026 Wuhan I] Prime Game

内存限制:512 MiB 时间限制:1000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

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

Initially, they share a positive integer . 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 () and replace the current with .
  2. Kaguya goes second: She must choose a prime number that divides the current (i.e., ) and replace the current with .

The above operations repeat continuously. If 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.

输入格式

The first line contains an integer (), representing the initial number of the game.

输出格式

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

样例

样例输入 1

1

样例输出 1

0

样例输入 2

9

样例输出 2

4

样例输入 3

16

样例输出 3

5