const DIVISOR: u64 = 10u64.pow(9) + 7; fn main() { let mut n = String::new(); std::io::stdin().read_line(&mut n).ok(); let n: u64 = n.trim().parse().unwrap(); let mut c = (1, 0, 0); for _ in 0..n { c = ((c.1 + c.2) % DIVISOR, c.0, c.1); } println!("{}", (c.0 + c.1 + c.2) % DIVISOR); }