Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/while-3-ning-darajasi-n-dan-kichik

Power of three not above n

Easy 1000 ms 64 MB 25%
Share

A positive integer $n$ is given ($n \ge 3$). Find the largest positive integer $k$ satisfying the inequality:

$$3^{k} \le n$$

The largest power of three not exceeding the given number

Input

One integer $n$.

Output

One integer — $k$.

Note

$3 \le n \le 10^{9}$

Examples

Input #1
10
Output #1
2
Input #2
27
Output #2
3

Sign in to submit a solution

Signing up is free and takes a minute.