using System; using System.Collections; using System.Collections.Generic; using System.Collections.Specialized; using System.Text; using System.Text.RegularExpressions; using System.Linq; class Magatro { static int N = int.Parse(Console.ReadLine()); const long MOD = 10000000000; static void Main() { long Integer = 0; long Fre = 0; for (int i = 0; i < N; i++) { string num = Console.ReadLine(); bool pos = num[0] != '-'; if (!pos) { num = num.Remove(0, 1); } string[] n = num.Split('.'); if (pos) { Integer += long.Parse(n[0]); if (n.Length == 2) { Fre += long.Parse(n[1].PadRight(10, '0')); } } else { Integer -= long.Parse(n[0]); if (n.Length == 2) { Fre -= long.Parse(n[1].PadRight(10, '0')); } } } Integer += Fre / MOD; Fre %= MOD; bool Plus; if (Integer > 0) { Plus = true; if (Fre < 0) { Integer--; Fre += MOD; } } else if (Integer < 0) { Plus = false; if (Fre > 0) { Integer++; Fre -= MOD; } Fre *= -1; Integer *= -1; } else { Plus = Fre >= 0; if(!Plus) Fre *= -1; } if (!Plus) { Console.Write("-"); } Console.Write("{0}.{1}", Integer, Fre.ToString().PadLeft(10, '0')); Console.WriteLine(); } }