Problem:
Score : 200 points

Problem Statement

Takahashi has a deposit of 100 yen (the currency of Japan) in AtCoder Bank.

The bank pays an annual interest rate of 1 % compounded annually. (A fraction of less than one yen is discarded.)

Assuming that nothing other than the interest affects Takahashi's balance, in how many years does the balance reach X yen or above for the first time?

Constraints

101 \le X \le 10^{18}

All values in input are integers.

Input

Input is given from Standard Input in the following format:

X

Output

Print the number of years it takes for Takahashi's balance to reach X yen or above for the first time.

Sample Input 1

103

Sample Output 1

3

The balance after one year is 101 yen.

The balance after two years is 102 yen.

The balance after three years is 103 yen.

Thus, it takes three years for the balance to reach 103 yen or above.

Sample Input 2

1000000000000000000

Sample Output 2

3760

Sample Input 3

1333333333

Sample Output 3

1706

Solution in Rust (1.42.0) (judge verdict: Accepted)

use input::{Input, ReadMode};

fn main() {
    let mut input = Input::new(ReadMode::Line);

    let x: u64 = input.parse();

    let mut a = 100u64;
    let mut c = 0;
    while a < x {
        a += a / 100;
        c += 1;
    }

    println!("{}", c);
}

#[allow(dead_code)]
pub mod input {
    use std::io::{BufRead, Read};
    use std::str::{FromStr, SplitAsciiWhitespace};

    pub enum ReadMode {
        Full,
        Line,
    }

    pub struct Input<'a> {
        lock: std::io::StdinLock<'static>,
        iter: Option<SplitAsciiWhitespace<'a>>,
        mode: ReadMode,
    }

    impl<'a> Input<'a> {
        fn naive_read(&mut self) -> Option<SplitAsciiWhitespace<'a>> {
            let mut s = Box::leak(Box::new(String::new()));
            let res = match self.mode {
                ReadMode::Full => self.lock.read_to_string(&mut s),
                ReadMode::Line => self.lock.read_line(&mut s),
            };
            res.ok().expect("failed to read");
            Some(s.split_ascii_whitespace())
        }
        pub fn new(mode: ReadMode) -> Self {
            let lock = Box::leak(Box::new(std::io::stdin())).lock();
            let iter = None;
            Self { lock, iter, mode }
        }
        pub fn read_line(&mut self) -> String {
            let mut s = String::new();
            self.lock.read_line(&mut s).ok().expect("failed to read");
            s
        }
        pub fn parse<T: FromStr>(&mut self) -> T {
            match &mut self.iter {
                Some(iter) => {
                    let x = match iter.next() {
                        Some(x) => x,
                        None => {
                            self.iter = self.naive_read();
                            self.iter.as_mut().unwrap().next().expect("reached EOF")
                        }
                    };
                    x.parse().ok().expect("failed to parse")
                }
                None => {
                    self.iter = self.naive_read();
                    self.parse()
                }
            }
        }
    }
}