P27176 [AtCoder] Word Chain
普及
题目描述

Problem Description

Mr. Snuke the black cat is playing a word chain game alone.

The words Mr. Snuke can use are all strings of one or more characters consisting of 26 alphabets. Note that they do not necessarily need to be valid English words.

Mr. Snuke used \( N \) words in the word chain. What is the minimum possible total length of these \( N \) words?

Input Format

The input is given from the standard input in the following format:

\( N \)

Output Format

Output the minimum possible total length of the \( N \) words used in the word chain by Mr. Snuke.

Sample Input and Output

Sample Input #1

4

Sample Output #1

6

Sample Input #2

1000

Sample Output #2

2272

Notes/Hints

Constraints

  • \( 1 \leq N \leq 10^9 \)

Sample Explanation 1

For example, if the word chain is a → an → n → na, the total length of the words is \( 6 \). Note that the same word cannot be used more than once.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
4
样例输出
6