require "big" k=BigInt.new(read_line) puts 6+4*(k**2-1)