N = gets.chomp.to_i

arr = Array.new(4){ Array.new(4){ Array.new(4){ Array.new(2, 1) }}}

arr[0][2][1][0]=0
arr[0][1][2][0]=0
arr[2][0][1][0]=0

for i in 4..N
  for j in 0..3
    for k in 0..3
      for l in 0..3
        if j == 2 && l == 1
          arr[j][k][l][(i+1)%2] = (arr[1][j][k][i%2] + arr[2][j][k][i%2] + arr[3][j][k][i%2])%1000000007
        elsif k == 2 && l == 1
          arr[j][k][l][(i+1)%2] = (arr[1][j][k][i%2] + arr[2][j][k][i%2] + arr[3][j][k][i%2])%1000000007
        else
          arr[j][k][l][(i+1)%2] = (arr[0][j][k][i%2] + arr[1][j][k][i%2] + arr[2][j][k][i%2] + arr[3][j][k][i%2])%1000000007
        end
      end
    end
  end
  arr[0][2][1][(i+1)%2]=0
  arr[0][1][2][(i+1)%2]=0
  arr[2][0][1][(i+1)%2]=0
end

answer = 0
for j in 0..3
  for k in 0..3
    for l in 0..3
      answer += arr[j][k][l][(N+1)%2]
    end
  end
end
puts(answer%1000000007)