# 【LNOI/JLOI/SHOI2016】【BZOJ4561】圆的异或并

//被坑了两次之后，我算是发现double比较大小有多不准了，解决方法详见代码40行

#include<cstdio>
#include<set>
#include<algorithm>
#include<cmath>
using namespace std;
#define maxn 200005
#define long long long
int n;
double X;
struct circle
{
long x;
long y;
long r;
int parametre;
long area(){return r*r*parametre;}
double dis(){return sqrt(r*r-(x-X)*(x-X));}
}full[maxn];
struct keypoint
{
circle *belong;
long x;
int end;
keypoint(circle *c,int t):belong(c),end(t){x=c->x+c->r*t;}
keypoint(){};
}kp[maxn*2];
struct arch
{
circle *belong;
int type;
arch(circle *c,int t):belong(c),type(t){}
double y()
{
return (double)belong->y+belong->dis()*type;
}
};
bool operator < (arch a,arch b)
{
return ((a.y()==b.y())?a.type<b.type:a.y()<b.y());
}
bool operator < (const keypoint &a,
const keypoint &b){return a.x<b.x;}
set<arch> arc;
int main()
{
scanf("%d",&n);
for(int i=1;i<=n;i++)
{
kp[i*2-1]=keypoint(full+i,-1);
kp[i*2]=keypoint(full+i,1);
}
sort(kp+1,kp+1+2*n);
for(int i=1;i<=2*n;i++)
{
X=kp[i].x;
if(kp[i].end==1) arc.erase(arch(kp[i].belong,-1)),arc.erase(arch(kp[i].belong,1));
else
{
arc.insert(arch(kp[i].belong,-1));
arc.insert(arch(kp[i].belong,1));
set<arch>::iterator it=arc.find(arch(kp[i].belong,-1));
if(it==arc.begin()) kp[i].belong->parametre=1;
else
{
it--;
kp[i].belong->parametre=it->type*(it->belong->parametre);
}

}
}
long ans=0;
//for(int i=1;i<=n;i++) printf("%d %d\n",i,full[i].parametre);
for(int i=1;i<=n;i++) ans+=full[i].area();
printf("%lld\n",ans);
return 0;
}