N = gets.to_i dp = [4, 3] (2..N).each{|k| dp[k] = (19 * dp[k-1] - 12 * dp[k - 2]).quo(4) } puts "%.10f"%dp[N]