#![allow(unused_imports)] #![allow(non_snake_case)] use std::collections::VecDeque; #[allow(unused_macros)] macro_rules! read { ([$t:ty] ; $n:expr) => ((0..$n).map(|_| read!([$t])).collect::>()); ($($t:ty),+ ; $n:expr) => ((0..$n).map(|_| read!($($t),+)).collect::>()); ([$t:ty]) => (rl().split_whitespace().map(|w| w.parse().unwrap()).collect::>()); ($t:ty) => (rl().parse::<$t>().unwrap()); ($($t:ty),*) => {{ let buf = rl(); let mut w = buf.split_whitespace(); ($(w.next().unwrap().parse::<$t>().unwrap()),*) }}; } #[allow(dead_code)] fn rl() -> String { let mut buf = String::new(); std::io::stdin().read_line(&mut buf).unwrap(); buf.trim_end().to_owned() } trait IteratorExt: Iterator + Sized { fn vec(self) -> Vec { self.collect() } } impl IteratorExt for T {} fn main() { let n = read!(usize); let mut table = vec![0usize; 4.max(n+1)]; table[1] = 1; // k table[2] = 2; // kp, kk table[3] = 2; // kkp, kpk for i in 4..=n { table[i] = (table[i-2] + table[i-3]) % 1000000007; } println!("{}", table[n]); }