require 'Matrix' N = gets.to_i A = Matrix[[19, -12], [4, 0]] ans = if N == 0 4 else B = A**(N - 1) (3 * B[0, 0] + 4 * B[0, 1]) / 4.0**(N - 1) end puts ans