use std::{
    collections::{BTreeSet, HashMap},
    hash::Hash,
};

const TEN9PLUS7: u64 = 1000000007;
fn main() {
    proconio::input! {
        n: usize,
    }
    let mut last = (0, 1, 0);
    for _ in 0..n - 1 {
        let next = ((last.1 + last.2) % TEN9PLUS7, last.0, last.1);
        //eprintln!("{next:?}");
        last = next;
    }
    println!("{}", (last.0 + last.1 + last.2) % TEN9PLUS7);
}