use std::io;

fn main() {
    println!("Please enter the nth number in the Fibonacci sequence.");

    let mut n = String::new();
    io::stdin().read_line(&mut n).expect("Failed to read line");

    let n: u32 = n.trim().parse().expect("Please enter a valid number!");

    let mut first = 0;
    let mut second = 1;

    for _ in 2..=n {
        let sum = first + second;
        first = second;
        second = sum;
    }

    println!("The {}th Fibonacci number is: {}", n, second);
}