We work with sequences of letters. A sequence x1,x2,…,xn contains a stammer if some block of consecutive letters is immediately followed by an identical block. Formally, there exist indices i and j with 1≤i<j and 2j−i−1≤n such that
xi=xj,xi+1=xj+1,…,xj−1=x2j−i−1.
Equivalently, the sequence contains a square: a factor of the form ww for some non-empty word w. A sequence with no such repeated block is called stammer-free.
We want to build a stammer-free sequence of length n using as few distinct letters as possible.
Some observations:
Determine the minimal number of different letters needed.
The first line of standard input contains one positive integer n (1≤n≤10,000,000) — the desired length of the sequence.
Print a single positive integer k: the minimal number of distinct letters that must appear in any stammer-free sequence of length n.