#include using namespace std; #define all(v) v.begin(), v.end() #define ll long long #define rep(i, n) for (ll i = 0; i < n; ++i) #define rep_up(i, a, b) for (ll i = a; i < b; ++i) #define rep_down(i, a, b) for (ll i = a; i > b; --i) #define P pair #define Graph vector> #define fi first #define se second #define vvvvll vector>>> #define vvvll vector>> #define vvll vector> #define vll vector #define vvvvdo vector>>> #define vvvdo vector>> #define vvdo vector> #define vdo vector #define pqll priority_queue #define pqllg priority_queue, greater> constexpr ll INF = (1ll << 60); constexpr ll mod = 998244353; // constexpr ll mod = 67280421310721; // constexpr ll mod = 1000000007; constexpr double pi = 3.14159265358979323846; template inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T &a, T b) { if (a > b) { a = b; return 1; } return 0; } template void pt_vll(vector &v) { ll vs = v.size(); rep(i, vs) { cout << v[i]; if (i == vs - 1) cout << "\n"; else cout << " "; } } template void pt_vvll(vector> &v) { ll vs = v.size(); rep(i, vs) pt_vll(v[i]); } template void pt(T val) { cout << val << "\n"; } ll gcd(ll a, ll b) { if (a % b == 0) return b; return gcd(b, a % b); } ll lcm(ll a, ll b) { return a / gcd(a, b) * b; } ll modinv(ll a, ll m) { ll b = m, u = 1, v = 0; while (b) { ll t = a / b; a -= t * b; swap(a, b); u -= t * v; swap(u, v); } u %= m; if (u < 0) u += m; return u; } ll modpow(ll x, ll n) { ll ret = 1; while (n > 0) { if (n & 1) ret = ret * x % mod; // n の最下位bitが 1 ならば x^(2^i) をかける x = x * x % mod; n >>= 1; // n を1bit 左にずらす } return ret; } ll minv(ll a, ll m) { return modpow(a, m - 2); } string To_String(ll a) { string ret; if (a == 0) return "0"; ll minus = false; if (a < 0) { minus = true; a *= -1; } while (a) { ret.push_back(a % 10 + '0'), a /= 10; } if (minus) ret.push_back('-'); reverse(all(ret)); return ret; } P double_to_long_long(string s, ll dig) { bool minus = false; if (s[0] == '-') { s = s.substr(1); minus = true; } ll Int = 0, Dic = 0; ll i; // 整数部分 for (i = 0; i < s.size() && s[i] != '.'; i++) { Int = Int * 10 + s[i] - '0'; } // 小数部分 ll mul = 1; while (--dig) mul *= 10; for (ll j = i + 1; j < s.size(); j++) { Dic += (s[j] - '0') * mul; mul /= 10; } if (minus) { Int *= -1, Dic *= -1; } return {Int, Dic}; } int main() { ll N; cin >> N; vector A(N); rep(i, N) cin >> A[i]; ll Int = 0, Dic = 0; rep(i, N) { P a = double_to_long_long(A[i], 10); Int += a.fi; Dic += a.se; } Int += (Dic / 10000000000); Dic %= 10000000000; if (Int > 0 && Dic < 0) { Dic += 10000000000; Int--; } else if (Int < 0 && Dic > 0) { Dic = abs(Dic - 10000000000); Int++; } else if (Int <= 0 && Dic < 0) { Dic *= -1; } string DIC = To_String(Dic); ll pz = To_String(10000000000).size() - DIC.size() - 1; reverse(all(DIC)); rep(i, pz) DIC.push_back('0'); reverse(all(DIC)); while (DIC.size() < 10) DIC.push_back('0'); cout << Int << '.' << DIC << "\n"; return 0; }