use std::io::prelude::*;

fn input<T>() -> T
    where T: std::str::FromStr {
    let stdin = std::io::stdin();
    let token: String = stdin
        .lock()
        .bytes()
        .map(|c| c.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().unwrap()
}


static MOD: usize = 1_000_000_000 + 7;
fn main() {
    let n = input::<usize>();
    let mut dp = vec![vec![vec![vec![0; 4]; 4]; 4]; 101];

    dp[0][3][3][3] = 1;
    for len in 0..n {
        // 最後から1文字目
        for c1 in 0..4 {
            // 最後から2文字目
            for c2 in 0..4 {
                // 最後から3文字目
                for c3 in 0..4 {
                    if dp[len][c1][c2][c3] == 0 {
                        continue;
                    }
                    // 新しく追加する文字列
                    for a in 0..4 {
                        if
                            a == 2 && c1 == 1 && c2 == 0 ||
                            a == 2 && c1 == 0 && c2 == 1 ||
                            a == 1 && c1 == 2 && c2 == 0 ||
                            a == 2 && c1 == 1 && c3 == 0 ||
                            a == 2 && c2 == 1 && c3 == 0 {
                           continue;
                        }

                        dp[len+1][a][c1][c2] += dp[len][c1][c2][c3];
                        dp[len+1][a][c1][c2] %= MOD;
                    }
                }
            }
        }
    }
    let mut ans = 0;
    for c1 in 0..4 {
        // 最後から2文字目
        for c2 in 0..4 {
            // 最後から3文字目
            for c3 in 0..4 {
                ans += dp[n][c1][c2][c3];
                ans %= MOD;
            }
        }
    }
    println!("{}", ans);
}

#[allow(unused_doc_comments)]
#[cfg(test)]
mod tests {
    #[test]
    fn tester() {
        let inputs = [
("
3
", "
61
"),

("
 4
", "
 230
"),

("
 100
","
388130742
"),
        ];

        for (input, expected) in inputs.iter() {
            call(input, expected.to_string());
        }
    }

    fn call<T: AsRef<str>>(input: T, expected: String) {
        use std::process::{Command, Stdio};
        use std::io::{Read, Write};

        let mut cmd_ls = Command::new("echo")
            .arg(input.as_ref())
            .stdout(Stdio::piped())
            .spawn()
            .unwrap();
        let mut cmd_grep = Command::new("cargo")
            .arg("run")
            .stdin(Stdio::piped())
            .stdout(Stdio::piped())
            .spawn()
            .unwrap();

        if let Some(ref mut stdout) = cmd_ls.stdout {
            if let Some(ref mut stdin) = cmd_grep.stdin {
                let mut buf: Vec<u8> = Vec::new();
                stdout.read_to_end(&mut buf).unwrap();
                stdin.write_all(&buf).unwrap();
            }
        }

        let res = cmd_grep.wait_with_output().unwrap().stdout;

        let res_string: String = String::from_utf8(res.to_vec()).unwrap();

        // convert '\n' into space
        let actual = res_string
            .replace("\n", " ")
            .trim_end_matches(" ")
            .trim_start_matches(" ")
            .to_owned();
        let expected = expected
            .replace("\n", " ")
            .trim_end_matches(" ")
            .trim_start_matches(" ")
            .to_owned();

        // split into a vector
        let actual = actual
            .split(" ")
            .map(|s| s.parse::<f64>().unwrap())
            .collect::<Vec<_>>();
        let expected = expected
            .split(" ")
            .map(|s| s.parse::<f64>().unwrap())
            .collect::<Vec<_>>();

        assert_eq!(actual, expected);
    }
}


Measured memory_bytes: 4352