#include <bits/stdc++.h>
using namespace std;
 
using ll = long long int;
using ull = unsigned long long int;
using P = pair<ll, ll>;
using P3 = pair<int,P>;
using PP = pair<P, P>;
constexpr int INF32 = 1 << 30;
constexpr ll INF64 = 1LL << 60;
constexpr ll MOD = 1000000007;
// constexpr ll MOD = 998244353;
constexpr int di[] = {0, 1, 0, -1};
constexpr int dj[] = {1, 0, -1, 0};
constexpr int di8[] = {0, 1, 1, 1, 0, -1, -1, -1};
constexpr int dj8[] = {1, 1, 0, -1, -1, -1, 0, 1};
constexpr double EPS = 1e-10;
const double PI = acos(-1);
 
#define ALL(v) (v).begin(),(v).end()
#define REP(i,n) for(int i=0,i_len=n; i<i_len; ++i)
 
template<typename T1,typename T2> bool chmax(T1 &a, T2 b) { if (a<b) { a=b; return 1; } return 0; }
template<typename T1,typename T2> bool chmin(T1 &a, T2 b) { if (b<a) { a=b; return 1; } return 0; }

int main(){
    int n;
    cin >> n;
    vector<ll> a(n);
    REP(i,n){
        cin >> a[i];
    }
    double l=0,r=INF32;
    REP(t,100){
        double x = l+(r-l)/3, y = r-(r-l)/3;
        double ex = x, ey = y;
        REP(i,n) ex += max(double(a[i])-x*2,0.)/n;
        REP(i,n) ey += max(double(a[i])-y*2,0.)/n;
        if(ex < ey){
            r = y;
        }else{
            l = x;
        }
    }
    double ans = l;
    REP(i,n) ans += max(double(a[i])-l*2,0.)/n;
    printf("%.9lf\n", ans);
    return 0;
}
#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int t,count=0,i,j,sum,x,y;
  cin>>t;
  for(i=0;i<t;i++)
  {
      //sum=0;
      cin>>x>>y;
      sum=y*(y+1)/2-x*(x+1)/2+x;


  count=count+sum;
  }
  cout<<count<<endl;

}
