class Calc0081 def initialize(args) args = args.map { |l| l.chomp.split(/\s+/) } @n = args.shift.first.to_i @as = args.map(&:first) end def run sum = @as.map { |a| t = a.split('.') t0 = t[0].to_i * 10 ** 10 t1 = (t[1] || '').ljust(10, '0').to_i * (a.start_with?('-') ? -1 : 1) t0 + t1 }.inject(:+) sign = sum >= 0 ? 1 : -1 "%d.%010d" % [(sum.abs / 10 ** 10) * sign, sum.abs % 10 ** 10] end end puts Calc0081.new(STDIN.readlines).run if __FILE__ == $0