P21254 [CodeChef] ES
提高+
题目描述

Read problems statements in Mandarin Chinese, Russian and Vietnamese as well.

Compute:
floor[1e] + floor[2e] + floor[3e] + ... + floor[ne],
where floor[x] is the largest integer that is not greater than x, and e is Euler's number: 2.7182818284...

------ Input ------

A single line which contains a single integer: n.

------ Output ------

A single line which contains a single integer which should be the answer.

------ Constraints ------

1 ≤ n ≤ 10^{4000}

------ Subtasks ------

$Subtask #1 (50 points): 1 ≤ n ≤ 10^{100}
$$Subtask #2 (50 points): Original constraints.$

----- Sample Input 1 ------
3
----- Sample Output 1 ------
15
----- explanation 1 ------

floor[1e] = floor[2.71828..] = 2.
floor[2
e] = floor[5.43656..] = 5.
floor[3*e] = floor[8.15484..] = 8.
So the answer is 2+5+8=15.

Note
Source code limit is 1000 bytes.

输入格式

见题面

输出格式

见题面

样例输入
3
样例输出
15