Numbairs#7327

Numbairs

1 second
122.174 megabytes
Very easy

Consider the number of the form a^{a^{a^{\ldots}}} where is a positive integer that can appear in the notation twice or more, ^ is power operation. Let us call such numbers numbairs (which stands for number + stairs). For instance 27 = 3^3 and 16 = 2^{2^2} are numbairs. Number is a numbair too since 1 = 1^1. Numbers , , are not numbairs because they cannot be represented in the required form. Find out how many numbairs there are between and inclusive.

Input

One integer (1 \leq n \leq 10^9).

Output

Print the number of numbairs not exceeding .

Examples

Example 1

Loading
Loading