#include using namespace std; #define FOR(i,a,b) for(int i=(a);i<(b);i++) #define REP(i,n) FOR(i,0,n) #define ALL(v) (v).begin(),(v).end() template inline bool chmax(A &a, B b) { if (a inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; } typedef unsigned long long ull; typedef long long ll; typedef pair pii; typedef pair pll; typedef pair P; const ll INF = 1ll<<29; const ll MOD = 1000000007; const double EPS = 1e-10; ll to_ll(string str) { stringstream ss(str); ll res; ss >> res; return res; } int n; vector a[2]; vector intpart[2], decpart[2]; ll sumint[2], sumdec[2]; bool msign; ll ansint, ansdec; int main() { cin >> n; REP(i, n) { string str; cin >> str; if (str[0] == '-') a[1].push_back(str.substr(1)); else a[0].push_back(str); } ll ten[11]; ten[0] = 1; REP(i, 10) ten[i + 1] = ten[i] * 10; REP(i, 2) REP(j, a[i].size()) { ll nowint = 0, nowdec = 0; if (a[i][j].find(".") == string::npos) nowint = to_ll(a[i][j]); else { nowint = to_ll(a[i][j].substr(0, a[i][j].find("."))); string tmp = a[i][j].substr(a[i][j].find(".") + 1); nowdec = to_ll(tmp) * ten[10 - tmp.size()]; } sumint[i] += nowint; sumdec[i] += nowdec; ll inc = sumdec[i] / 10000000000ll; sumint[i] += inc; sumdec[i] -= inc * 10000000000ll; } if (sumint[0] == sumint[1]) { ansint = 0; if (sumdec[0] < sumdec[1]) msign = true; ansdec = abs(sumdec[0] - sumdec[1]); } else { bool f = sumint[0] < sumint[1]; if (sumint[0] < sumint[1]) msign = true; if (f) { swap(sumint[0], sumint[1]); swap(sumdec[0], sumdec[1]); } ansint = sumint[0] - sumint[1]; if (sumdec[0] < sumdec[1]) { ansint--; ansdec = 10000000000ll - sumdec[1] + sumdec[0]; } else ansdec = sumdec[0] - sumdec[1]; } printf("%s%lld.%010lld\n", msign ? "-" : "", ansint, ansdec); return 0; } /* 2 0.1 -1 */