n = gets.to_i
dp = Array.new(n).map{Array.new(4).map{Array.new(4).map{Array.new(4,0)}}}
mod = 10**9+7
4.times do |i|
    dp[0][0][0][i] = 1
end
4.times do |i|
    4.times do |j|
        dp[1][0][i][j] = 1
    end
end
4.times do |i|
    4.times do |j|
        4.times do |k|
            dp[2][i][j][k] += dp[1][0][i][j] if !(i == 0 && j == 2 && k == 1) && !(i == 0 && j == 1 && k == 2) && !(i == 2 && j == 0 && k == 1)
        end
    end
end
for i in 3..n-1
    4.times do |j|
        4.times do |k|
            4.times do |l|
                4.times do |m|
                    dp[i][j][k][l] += dp[i-1][m][j][k] if !(j == 0 && k == 2 && l == 1) && !(j == 0 && k == 1 && l == 2) && !(j == 2 && k == 0 && l == 1) && !(m == 0 && j == 2 && l == 1) && !(m == 0 && k == 2 && l == 1)
                    dp[i][j][k][l] %= mod
                end
            end
        end
    end
end
ans = 0
4.times do |i|
    4.times do |j|
        4.times do |k|
            ans += dp[n-1][i][j][k]
            ans %= mod
        end
    end
end
puts ans