#include "bits/stdc++.h" using namespace std; #define DEBUG(x) cout<<#x<<": "< #define vl vector #define vii vector< vector > #define vll vector< vector > #define vs vector #define pii pair #define pis pair #define psi pair const int inf = 1000000001; const ll INF = 1e16; #define MOD 1000000007 #define mod 1000000009 #define pi 3.14159265358979323846 #define Sp(p) cout<> n; vs sei, fu; for (i = 0; i < n; i++) { string s; cin >> s; if (s[0] == '-') { fu.push_back(s); } else { sei.push_back(s); } } vi sumsei(31); //sum[30]が小数第10位、sum[20]が1の位、sum[19]が10の位 for (i = 0; i < sei.size(); i++) { string b = "?"; for (j = 0; j < sei[i].size(); j++) { if (sei[i][j] == '.') { b = sei[i].substr(j + 1, sei[i].size() - j - 1); sei[i] = sei[i].substr(0, j); } } for (j = sei[i].size() - 1; j >= 0; j--) { sumsei[21 - sei[i].size() + j] += sei[i][j] - '0'; } if (b != "?") { for (j = 0; j < b.size(); j++) { sumsei[21 + j] += b[j] - '0'; } } } vi sumfu(31); for (i = 0; i < fu.size(); i++) { string b = "?"; fu[i].erase(fu[i].begin()); for (j = 0; j < fu[i].size(); j++) { if (fu[i][j] == '.') { b = fu[i].substr(j + 1, fu[i].size() - j - 1); fu[i] = fu[i].substr(0, j); } } for (j = fu[i].size() - 1; j >= 0; j--) { sumfu[21 - fu[i].size() + j] += fu[i][j] - '0'; } if (b != "?") { for (j = 0; j < b.size(); j++) { sumfu[21 + j] += b[j] - '0'; } } } //DEBUG_VEC(sumsei); //DEBUG_VEC(sumfu); for (i = 0; i < 31; i++) { sumsei[i] -= sumfu[i]; } for (i = 30; i >= 0; i--) { if (sumsei[i] < 0) { int cnt = sumsei[i] / 10 + 1; sumsei[i - 1] -= cnt; sumsei[i] += 10 * cnt; } else if (sumsei[i] >= 10) { int cnt = sumsei[i] / 10; sumsei[i] -= cnt * 10; sumsei[i - 1] += cnt; } } string s; for (i = 0; i < 31; i++) { s.push_back(sumsei[i] + '0'); if (i == 20) { s.push_back('.'); } } while (s[0] == '0') { s.erase(s.begin()); } if (s[0] == '.') { s = '0' + s; } cout << s << endl; }