MOD = 1000000007

def mul(a,b)
  return a*b % MOD
end

n = gets.to_i


x = []

for i in 0..2 do
  x[i] = 4 ** i % MOD
end

x[3] = 61
if n == 3
  puts x[n]
  exit
end

for i in 4..100 do
  x[i] = mul(4, x[i-1]) - mul(2,x[i-3]) - mul(6,x[i-4]) % MOD
  if n == i
    puts x[n]
    exit
  end
end
