#include #include #include #include #include #include #include #include #include // require sort next_permutation count __gcd reverse etc. #include // require abs exit atof atoi #include // require scanf printf #include #include // require accumulate #include // require fabs #include #include #include #include // require setw #include // require stringstream #include // require memset #include // require tolower, toupper #include // require freopen #include // require srand #define rep(i,n) for(int i=0;i<(n);i++) #define ALL(A) A.begin(), A.end() using namespace std; typedef long long ll; typedef pair P; typedef pair LL; LL func (string s ){ ll sign = 1LL; if (s[0] == '-' ) { sign = -1LL; s = s.substr (1 ); } // end if rep (i, s.length() ) if (s[i] == '.' ) s[i] = ' '; stringstream ss (s ); ll integer = 0LL; string decimal = ""; ss >> integer >> decimal; while (decimal.length() < 10 ){ decimal += '0'; } // end while stringstream tt (decimal ); ll dec; tt >> dec; return LL (sign*integer, sign*dec ); } string ll2s (ll m ){ stringstream ss; ss << m; string res; ss >> res; while (res.length() < 10 ){ res = '0' + res; } // end while return res; } int main() { ios_base::sync_with_stdio(0); int N; cin >> N; vector num(N); rep (i, N ){ string s; cin >> s; num[i] = func (s ); } // end rep ll sumi = 0LL, sumd = 0LL; rep (i, N ){ sumi += num[i].first; sumd += num[i].second; // cerr << num[i].first << '.' << num[i].second << endl; } // end rep while (sumd < 0LL ){ sumi--; sumd += (ll)1e10; } // end while while (sumd >= (ll)1e10 ){ sumi++; sumd -= (ll)1e10; } // end while if (sumi < 0LL && sumd >= 0LL ){ sumi++, sumd = (ll)1e10 - sumd; } // end if printf ("%lld.%010lld\n", sumi, sumd ); return 0; }