#include <bits/stdc++.h>
using namespace std;

const double ep = 1e-10, pi = acos(-1);

struct pnt {
	double x, y;
	pnt (double x = 0, double y = 0): x(x), y(y) {}
	inline pnt operator - (const pnt &a) const { return pnt(x - a.x, y - a.y); }
	inline pnt operator + (const pnt &a) const { return pnt(x + a.x, y + a.y); }
	inline pnt operator * (const double &a) const { return pnt(x * a, y * a); }
	inline pnt operator / (const double &a) const { return pnt(x / a, y / a); }
	inline double operator & (const pnt &a) const { return x * a.x + y * a.y; }
	inline double operator ^ (const pnt &a) const { return x * a.y - y * a.x; }
	inline void input() { x = y = 0, scanf("%lf %lf", &x, &y); }
	void FastInput() {
		int a, b;
		scanf("%d %d", &a, &b);
		x = 1.0 * a;
		y = 1.0 * b;
	}
	inline void print() { printf("%lf %lf\n", x, y); }
	inline bool operator < (const pnt &a) const {
		if (fabs(x - a.x) > ep) return x < a.x;
		return y < a.y;
	}
	inline bool operator == (const pnt &a) const {
		return fabs(x - a.x) < ep && fabs(y - a.y) < ep;
	}
	inline pnt Rotate(const double &angle) {
		pnt R = pnt(sin(angle), cos(angle)), C = *this;
		return pnt(C ^ R, C & R);
	}
	inline double dist() { return sqrt(x * x + y * y); }
	inline pnt norm() { return (*this) / dist(); }
} O[3], p[3];

double R[3];

double dist(pnt a) {return sqrt(a.x * a.x + a.y * a.y);}

double common_circles(pnt c, double r, pnt cc, double rr){
	if (r<rr){
		swap(c,cc);
		swap(r,rr);
	}
	double d=dist(c-cc);
	if (rr+d<=r) return pi*rr*rr;
	if (r+rr<=d) return 0;
	double x=(r*r-rr*rr+d*d)/(d*2);
	double xx=d-x;
	double res1=acos(x/r)*r*r-x*sqrt(r*r-x*x);
	double res2=acos(xx/rr)*rr*rr-xx*sqrt(rr*rr-xx*xx);
	return res1+res2;
}

int main() {
//	freopen("d.in", "r", stdin);
	O[1].input();
	scanf("%lf", &R[1]);
	O[2].input();
	scanf("%lf", &R[2]);
	printf("%.12lf\n", common_circles(O[1], R[1], O[2], R[2]));
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

typedef long double LD;

const LD ep = 1e-10, pi = acos(-1);

struct pnt {
	LD x, y;
	pnt (LD x = 0, LD y = 0): x(x), y(y) {}
	inline pnt operator - (const pnt &a) const { return pnt(x - a.x, y - a.y); }
	inline pnt operator + (const pnt &a) const { return pnt(x + a.x, y + a.y); }
	inline pnt operator * (const LD &a) const { return pnt(x * a, y * a); }
	inline pnt operator / (const LD &a) const { return pnt(x / a, y / a); }
	inline LD operator & (const pnt &a) const { return x * a.x + y * a.y; }
	inline LD operator ^ (const pnt &a) const { return x * a.y - y * a.x; }
	inline void input() { double xx, yy; scanf("%lf %lf", &xx, &yy); x = xx, y = yy; }
	void FastInput() {
		int a, b;
		cin >> a >> b;
		x = 1.0 * a;
		y = 1.0 * b;
	}
	inline void print() { printf("%lf %lf\n", (double)x, (double) y); }
	inline bool operator < (const pnt &a) const {
		if (fabs(x - a.x) > ep) return x < a.x;
		return y < a.y;
	}
	inline bool operator == (const pnt &a) const {
		return fabs(x - a.x) < ep && fabs(y - a.y) < ep;
	}
	inline pnt Rotate(const LD &angle) {
		pnt R = pnt(sin(angle), cos(angle)), C = *this;
		return pnt(C ^ R, C & R);
	}
	inline LD dist() { return sqrt(x * x + y * y); }
	inline pnt norm() { return (*this) / dist(); }
} O[3], p[3];

double R[3];

LD dist(pnt a) {return sqrt(a.x * a.x + a.y * a.y);}

LD common_circles(pnt c, LD r, pnt cc, LD rr){
	if (r<rr){
		swap(c,cc);
		swap(r,rr);
	}
	LD d=dist(c-cc);
	if (rr+d<=r + ep) return pi*rr*rr;
	if (r+rr<=d + ep) return 0;
	LD x=2*acos((r*r-rr*rr+d*d)/(d*2*r));
	LD xx=2*acos((-r*r+rr*rr+d*d)/(d*2*rr));
	LD res1=0.5*r*r*(x-sin(x));
	LD res2=0.5*rr*rr*(xx-sin(xx));
	return res1+res2;
}

int main() {
	O[1].input();

	scanf("%lf", &R[1]);
	O[2].input();

	scanf("%lf", &R[2]);
	//printf("%lf %lf\n", R[1], R[2]);
	printf("%.12lf\n", (double)common_circles(O[1], R[1], O[2], R[2]));
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

typedef long double LD;

const LD ep = 1e-7, pi = acos(-1);

struct pnt {
	LD x, y;
	pnt (LD x = 0, LD y = 0): x(x), y(y) {}
	inline pnt operator - (const pnt &a) const { return pnt(x - a.x, y - a.y); }
	inline pnt operator + (const pnt &a) const { return pnt(x + a.x, y + a.y); }
	inline pnt operator * (const LD &a) const { return pnt(x * a, y * a); }
	inline pnt operator / (const LD &a) const { return pnt(x / a, y / a); }
	inline LD operator & (const pnt &a) const { return x * a.x + y * a.y; }
	inline LD operator ^ (const pnt &a) const { return x * a.y - y * a.x; }
	inline void input() { double xx, yy; scanf("%lf %lf", &xx, &yy); x = xx, y = yy; }
	void FastInput() {
		int a, b;
		cin >> a >> b;
		x = 1.0 * a;
		y = 1.0 * b;
	}
	inline void print() { printf("%lf %lf\n", (double)x, (double) y); }
	inline bool operator < (const pnt &a) const {
		if (fabs(x - a.x) > ep) return x < a.x;
		return y < a.y;
	}
	inline bool operator == (const pnt &a) const {
		return fabs(x - a.x) < ep && fabs(y - a.y) < ep;
	}
	inline pnt Rotate(const LD &angle) {
		pnt R = pnt(sin(angle), cos(angle)), C = *this;
		return pnt(C ^ R, C & R);
	}
	inline LD dist() { return sqrt(x * x + y * y); }
	inline pnt norm() { return (*this) / dist(); }
} O[3], p[3];

double R[3];

LD dist(pnt a) {return sqrt(a.x * a.x + a.y * a.y);}

LD common_circles(pnt c, LD r, pnt cc, LD rr){
	if (r<rr){
		swap(c,cc);
		swap(r,rr);
	}
	LD d=dist(c-cc);
	if (rr+d<=r + ep) return pi*rr*rr;
	if (r+rr<=d + ep) return 0;
	LD x=(r*r-rr*rr+d*d)/(d*2);
	LD xx=d-x;
	LD res1=acos(x/r)*r*r-x*sqrt(r*r-x*x);
	LD res2=acos(xx/rr)*rr*rr-xx*sqrt(rr*rr-xx*xx);
	return res1+res2;
}

int main() {
	//freopen("d.in", "r", stdin);
	O[1].input();

	scanf("%lf", &R[1]);
	O[2].input();

	scanf("%lf", &R[2]);
	//printf("%lf %lf\n", R[1], R[2]);
	printf("%.12lf\n", (double)common_circles(O[1], R[1], O[2], R[2]));
	return 0;
}


#include <iostream>
#include <iomanip>
#include <climits>
#include <stack>
#include <fstream>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <set>
#include <map>
#include <cassert>

#define FOR(i,n) for(int i=0,_n=n;i<_n;i++)
#define FORR(i,s,n) for(int i=s,_n=n;i<_n;i++)
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define pli pair<ll,int>
#define vi vector<int>
#define fs first
#define sec second

#define maxn 100000

using namespace std;
typedef long long ll;

const ll MOD = 1000000007LL;
const long double PI = 3.1415926535897932384;

int main(){
	long double x1,y1,r1,x2,y2,r2;
	cin >> x1 >> y1 >> r1;
	cin >> x2 >> y2 >> r2;
	long double d=hypot(x2-x1,y2-y1);
	if(r1>r2)swap(r1,r2);
	if(r1+r2<=d){
		printf("0\n");
		return 0;
	}
	if(r1+d<=r2){
		cout << fixed<<setprecision(12)<<PI*r1*r1<<"\n";
		return 0;
	}
	long double y=(r2*r2+d*d-r1*r1)/(2*d);
	long double x=d-y;
	long double phi1=2*acos(x/r1);
	long double phi2=2*acos(y/r2);
	long double p1=(r1*r1*(phi1-sin(phi1)))/2;
	long double p2=(r2*r2*(phi2-sin(phi2)))/2;
	long double rez=p1+p2;
	cout << fixed <<setprecision(20)<<rez<<"\n";
	return 0;
}


#include <iostream>
#include <iomanip>
#include <climits>
#include <stack>
#include <fstream>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <set>
#include <map>
#include <cassert>

#define FOR(i,n) for(int i=0,_n=n;i<_n;i++)
#define FORR(i,s,n) for(int i=s,_n=n;i<_n;i++)
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define pli pair<ll,int>
#define vi vector<int>
#define fs first
#define sec second

#define maxn 100000

using namespace std;
typedef long long ll;

const ll MOD = 1000000007LL;
const long double PI = 3.1415926535897932384;

int main(){
	long double x1,y1,r1,x2,y2,r2;
	cin >> x1 >> y1 >> r1;
	cin >> x2 >> y2 >> r2;
	long double d=hypot(x2-x1,y2-y1);
	if(r1>r2)swap(r1,r2);
	if(r1+r2<=d){
		printf("0\n");
		return 0;
	}
	if(r1+d<=r2){
		cout << fixed<<setprecision(12)<<PI*r1*r1<<"\n";
		return 0;
	}
	long double phi1=2*acos((r1*r1+d*d-r2*r2)/(2*d*r1));
	long double phi2=2*acos((r2*r2+d*d-r1*r1)/(2*d*r2));
	long double p1=(r1*r1*(phi1-sin(phi1)))/2;
	long double p2=(r2*r2*(phi2-sin(phi2)))/2;
	long double rez=p1+p2;
	cout << fixed <<setprecision(20)<<rez<<"\n";
	return 0;
}


#include <iostream>
#include <iomanip>
#include <climits>
#include <stack>
#include <fstream>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <set>
#include <map>
#include <cassert>

#define FOR(i,n) for(int i=0,_n=n;i<_n;i++)
#define FORR(i,s,n) for(int i=s,_n=n;i<_n;i++)
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define pli pair<ll,int>
#define vi vector<int>
#define fs first
#define sec second

#define maxn 100000

using namespace std;
typedef long long ll;

const ll MOD = 1000000007LL;
const long double PI = 3.1415926535897932384;

int main(){
	long double x1,y1,r1,x2,y2,r2;
	cin >> x1 >> y1 >> r1;
	cin >> x2 >> y2 >> r2;
	long double d=sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));
	if(r1>r2)swap(r1,r2);
	if(r1+r2<=d){
		printf("0\n");
		return 0;
	}
	if(r1+d<=r2){
		cout << fixed<<setprecision(20)<<PI*r1*r1<<"\n";
		return 0;
	}
	long double phi1=2*acos((r1*r1+d*d-r2*r2)/(2*d*r1));
	long double phi2=2*acos((r2*r2+d*d-r1*r1)/(2*d*r2));
	long double p1=(r1*r1*(phi1-sin(phi1)))/2;
	long double p2=(r2*r2*(phi2-sin(phi2)))/2;
	long double rez=p1+p2;
	cout << fixed <<setprecision(20)<<rez<<"\n";
	return 0;
}


#include <iostream>
#include <iomanip>
#include <climits>
#include <stack>
#include <fstream>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <set>
#include <map>
#include <cassert>

#define FOR(i,n) for(int i=0,_n=n;i<_n;i++)
#define FORR(i,s,n) for(int i=s,_n=n;i<_n;i++)
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define pli pair<ll,int>
#define vi vector<int>
#define fs first
#define sec second

#define maxn 100000

using namespace std;
typedef long long ll;

const ll MOD = 1000000007LL;
const long double PI = 3.1415926535897932384;

int main(){
	long double x1,y1,r1,x2,y2,r2;
	cin >> x1 >> y1 >> r1;
	cin >> x2 >> y2 >> r2;
	long double d=hypot(x2-x1,y2-y1);
	if(r1>r2)swap(r1,r2);
	if(r1+r2<=d){
		printf("0\n");
		return 0;
	}
	if(r1+d<=r2){
		cout << fixed<<setprecision(12)<<PI*r1*r1<<"\n";
		return 0;
	}
	long double phi1=2*acos(r1*r1+d*d-r2*r2/2*d*r1);
	long double phi2=2*acos(r2*r2+d*d-r1*r1/2*d*r2);
	long double p1=(r1*r1*(phi1-sin(phi1)))/2;
	long double p2=(r2*r2*(phi2-sin(phi2)))/2;
	long double rez=p1+p2;
	cout << fixed <<setprecision(20)<<rez<<"\n";
	return 0;
}


#include <iostream>
#include <iomanip>
#include <climits>
#include <stack>
#include <fstream>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <set>
#include <map>
#include <cassert>

#define FOR(i,n) for(int i=0,_n=n;i<_n;i++)
#define FORR(i,s,n) for(int i=s,_n=n;i<_n;i++)
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define pli pair<ll,int>
#define vi vector<int>
#define fs first
#define sec second

#define maxn 100000

using namespace std;
typedef long long ll;

const ll MOD = 1000000007LL;
const double PI = 3.1415926535897932384;

int main(){
	double x1,y1,r1,x2,y2,r2;
	scanf("%lf%lf%lf",&x1,&y1,&r1);
	scanf("%lf%lf%lf",&x2,&y2,&r2);
	double d=hypot(x2-x1,y2-y1);
	if(r1>r2)swap(r1,r2);
	if(r1+r2<=d){
		printf("0\n");
		return 0;
	}
	if(r1+d<=r2){
		cout << fixed<<setprecision(12)<<PI*r1*r1<<"\n";
		return 0;
	}
	double y=(r2*r2+d*d-r1*r1)/(2*d);
	double x=d-y;
	double v=sqrt(r1*r1-x*x);
	double phi1=2*acos(x/r1);
	double phi2=2*acos(y/r2);
	double p1=(r1*r1*(phi1-sin(phi1)))/2;
	double p2=(r2*r2*(phi2-sin(phi2)))/2;
	double rez=p1+p2;
	cout << fixed <<setprecision(12)<<rez<<"\n";
	return 0;
}


#include <iostream>
#include <iomanip>
#include <climits>
#include <stack>
#include <fstream>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <set>
#include <map>
#include <cassert>

#define FOR(i,n) for(int i=0,_n=n;i<_n;i++)
#define FORR(i,s,n) for(int i=s,_n=n;i<_n;i++)
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define pli pair<ll,int>
#define vi vector<int>
#define fs first
#define sec second

#define maxn 100000

using namespace std;
typedef long long ll;

const ll MOD = 1000000007LL;
const double PI = 3.1415926535897932384;

int main(){
	double x1,y1,r1,x2,y2,r2;
	scanf("%lf%lf%lf",&x1,&y1,&r1);
	scanf("%lf%lf%lf",&x2,&y2,&r2);
	double d=hypot(x2-x1,y2-y1);
	if(r1>r2)swap(r1,r2);
	if(r1+r2<=d){
		printf("0\n");
		return 0;
	}
	if(r1+d<=r2){
		cout << fixed<<setprecision(12)<<PI*r1*r1<<"\n";
		return 0;
	}
	double y=(r2*r2+d*d-r1*r1)/(2*d);
	double x=d-y;
	double v=sqrt(r1*r1-x*x);
	double phi1=2*atan(v/x);
	double phi2=2*atan(v/y);
	double p1=r1*r1*phi1/2;
	double p2=r2*r2*phi2/2;
	double rez=p1+p2-d*v;
	cout << fixed <<setprecision(12)<<rez<<"\n";
	return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<algorithm>
#define esp 1e-8

using namespace std;

struct Circle{
    long double x,y;
    long double r;
};

long double calArea(Circle c1, Circle c2)
{
    long double d;
    long double s,s1,s2,s3,angle1,angle2,temp;

    d=sqrt((c1.x-c2.x)*(c1.x-c2.x)+(c1.y-c2.y)*(c1.y-c2.y));
    if(d>=(c1.r+c2.r))//��Բ����
        return 0;
    if((c1.r-c2.r)>=d)//��Բ�ں�,c1��
        return acos(-1.0)*c2.r*c2.r;
    if((c2.r-c1.r)>=d)//��Բ�ں�,c2��
        return acos(-1.0)*c1.r*c1.r;

    angle1=acos((c1.r*c1.r+d*d-c2.r*c2.r)/(2*c1.r*d));
    angle2=acos((c2.r*c2.r+d*d-c1.r*c1.r)/(2*c2.r*d));

    s1=angle1*c1.r*c1.r;s2=angle2*c2.r*c2.r;
    s3=c1.r*d*sin(angle1);
    s=s1+s2-s3;

    return s;
}

Circle a,a1,b,b1;

int main (){
    while(cin>>a.x>>a.y>>a.r){
        cin>>b.x>>b.y>>b.r;
        cout.precision(12);
        cout<<calArea(a,b)<<endl;
    }
    return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<algorithm>
#define esp 1e-8

using namespace std;

struct Circle{
    long double x,y;
    long double r;
};

long double calArea(Circle c1, Circle c2)
{
    long double d;
    long double s,s1,s2,s3,s4,angle1,angle2,temp;

    d=sqrt((c1.x-c2.x)*(c1.x-c2.x)+(c1.y-c2.y)*(c1.y-c2.y));
    //printf("%.10f\n",d);
    if(d>=(c1.r+c2.r))//��Բ����
        return 0;
    if((c1.r-c2.r)>=d)//��Բ�ں�,c1��
        return acos(-1.0)*c2.r*c2.r;
    if((c2.r-c1.r)>=d)//��Բ�ں�,c2��
        return acos(-1.0)*c1.r*c1.r;
    angle1=acos((c1.r*c1.r+d*d-c2.r*c2.r)/(2*c1.r*d));
    angle2=acos((c2.r*c2.r+d*d-c1.r*c1.r)/(2*c2.r*d));
    //cout<<angle1<<"   "<<angle2<<endl;
    s1=angle1*c1.r*c1.r;
    s2=angle2*c2.r*c2.r;
    s3=c1.r*c1.r*sin(angle1)*cos(angle1);
    s4=c2.r*c2.r*sin(angle2)*cos(angle2);
    //cout<<s1-s3<<"   "<<s2-s4<<endl;
    //if(angle1>angle2)
      //  s=s1-s3;
    //else
        s=s1+s2-s3-s4;
    return s;
}

Circle a,b;

int main(){
    while(cin>>a.x>>a.y>>a.r){
        cin>>b.x>>b.y>>b.r;
        cout.precision(12);
        cout<<calArea(a,b)<<endl;
    }
    return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<algorithm>
#define esp 1e-8

using namespace std;

struct Circle{
    double x,y;
    double r;
};

double calArea(Circle c1, Circle c2)
{
    double d;
    double s,s1,s2,s3,s4,angle1,angle2,temp;

    d=sqrt((c1.x-c2.x)*(c1.x-c2.x)+(c1.y-c2.y)*(c1.y-c2.y));
    //printf("%.10f\n",d);
    if(d>=(c1.r+c2.r))//��Բ����
        return 0;
    if((c1.r-c2.r)>=d)//��Բ�ں�,c1��
        return acos(-1.0)*c2.r*c2.r;
    if((c2.r-c1.r)>=d)//��Բ�ں�,c2��
        return acos(-1.0)*c1.r*c1.r;
    angle1=acos((c1.r*c1.r+d*d-c2.r*c2.r)/2/c1.r/d);
    angle2=acos((c2.r*c2.r+d*d-c1.r*c1.r)/2/c2.r/d);
    //cout<<angle1<<"   "<<angle2<<endl;
    s1=angle1*c1.r*c1.r;
    s2=angle2*c2.r*c2.r;
    s3=c1.r*c1.r*sin(angle1)*cos(angle1);
    s4=c2.r*c2.r*sin(angle2)*cos(angle2);
    //cout<<s1-s3<<"   "<<s2-s4<<endl;
    //if(angle1>angle2)
      //  s=s1-s3;
    //else
        s=s1+s2-s3-s4;
    return s;
}

Circle a,b;

int main(){
    while(scanf("%lf%lf%lf",&a.x,&a.y,&a.r)!=EOF){
        scanf("%lf%lf%lf",&b.x,&b.y,&b.r);
        printf("%.10f\n",calArea(a,b));
    }
    return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<algorithm>
#define esp 1e-8

using namespace std;

struct Circle{
    double x,y;
    double r;
};

double calArea(Circle c1, Circle c2)
{
    double d;
    double s,s1,s2,s3,s4,angle1,angle2,temp;

    d=sqrt((c1.x-c2.x)*(c1.x-c2.x)+(c1.y-c2.y)*(c1.y-c2.y));
    //printf("%.10f\n",d);
    if(d>=(c1.r+c2.r))//��Բ����
        return 0;
    if((c1.r-c2.r)>=d)//��Բ�ں�,c1��
        return acos(-1.0)*c2.r*c2.r;
    if((c2.r-c1.r)>=d)//��Բ�ں�,c2��
        return acos(-1.0)*c1.r*c1.r;
    if(c1.r<c2.r){
        swap(c1.r,c2.r);
        swap(c1.x,c2.x);
        swap(c1.y,c2.y);
    }
    angle1=acos((c1.r*c1.r+d*d-c2.r*c2.r)/(2*c1.r*d));
    angle2=acos((c2.r*c2.r+d*d-c1.r*c1.r)/(2*c2.r*d));
    //cout<<angle1<<"   "<<angle2<<endl;
    s1=angle1*c1.r*c1.r;
    s2=angle2*c2.r*c2.r;
    s3=c1.r*c1.r*sin(angle1)*cos(angle1);
    s4=c2.r*c2.r*sin(angle2)*cos(angle2);
    //cout<<s1<<"   "<<s2<<"   "<<s3<<endl;
    s=s1+s2-s3-s4;

    return s;
}

Circle a,b;

int main(){
    while(scanf("%lf%lf%lf",&a.x,&a.y,&a.r)!=EOF){
        scanf("%lf%lf%lf",&b.x,&b.y,&b.r);
        printf("%.10f\n",calArea(a,b));
    }
    return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<algorithm>
#define esp 1e-8

using namespace std;

struct Circle{
    double x,y;
    double r;
};

double calArea(Circle c1, Circle c2)
{
    double d;
    double s,s1,s2,s3,angle1,angle2,temp;

    d=sqrt((c1.x-c2.x)*(c1.x-c2.x)+(c1.y-c2.y)*(c1.y-c2.y));
    if(d>=(c1.r+c2.r))//��Բ����
        return 0;
    if((c1.r-c2.r)>=d)//��Բ�ں�,c1��
        return acos(-1.0)*c2.r*c2.r;
    if((c2.r-c1.r)>=d)//��Բ�ں�,c2��
        return acos(-1.0)*c1.r*c1.r;

    angle1=acos((c1.r*c1.r+d*d-c2.r*c2.r)/(2*c1.r*d));
    angle2=acos((c2.r*c2.r+d*d-c1.r*c1.r)/(2*c2.r*d));

    s1=angle1*c1.r*c1.r;s2=angle2*c2.r*c2.r;
    s3=c1.r*d*sin(angle1);
    s=s1+s2-s3;

    return s;
}

Circle a,b;

int main(){
    while(scanf("%lf%lf%lf",&a.x,&a.y,&a.r)!=EOF){
        scanf("%lf%lf%lf",&b.x,&b.y,&b.r);
        printf("%.10f\n",calArea(a,b));
    }
    return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<algorithm>
#define esp 1e-8

using namespace std;

struct Circle{
    double x,y;
    double r;
};

double calArea(Circle c1, Circle c2)
{
    double d;
    double s,s1,s2,s3,s4,angle1,angle2,temp;

    d=sqrt((c1.x-c2.x)*(c1.x-c2.x)+(c1.y-c2.y)*(c1.y-c2.y));
    //printf("%.10f\n",d);
    if(d>=(c1.r+c2.r))//��Բ����
        return 0;
    if((c1.r-c2.r)>=d)//��Բ�ں�,c1��
        return acos(-1.0)*c2.r*c2.r;
    if((c2.r-c1.r)>=d)//��Բ�ں�,c2��
        return acos(-1.0)*c1.r*c1.r;
    angle1=acos((c1.r*c1.r+d*d-c2.r*c2.r)/2/c1.r/d);
    angle2=acos((c2.r*c2.r+d*d-c1.r*c1.r)/2/c2.r/d);
    //cout<<angle1<<"   "<<angle2<<endl;
    s1=angle1*c1.r*c1.r;
    s2=angle2*c2.r*c2.r;
    s3=c1.r*c1.r*sin(angle1)*cos(angle1);
    s4=c2.r*c2.r*sin(angle2)*cos(angle2);
    //cout<<s1-s3<<"   "<<s2-s4<<endl;
    //if(angle1>angle2)
      //  s=s1-s3;
    //else
        s=s1+s2-s3-s4;
    return s;
}

Circle a,b;

int main(){
    while(scanf("%lf%lf%lf",&a.x,&a.y,&a.r)!=EOF){
        scanf("%lf%lf%lf",&b.x,&b.y,&b.r);
        printf("%.20f\n",calArea(a,b));
    }
    return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<algorithm>
#define esp 1e-8

using namespace std;

struct Circle{
    double x,y;
    double r;
};

double calArea(Circle c1, Circle c2)
{
    double d;
    double s,s1,s2,s3,angle1,angle2,temp;

    d=sqrt((c1.x-c2.x)*(c1.x-c2.x)+(c1.y-c2.y)*(c1.y-c2.y));
    //printf("%.10f\n",d);
    if(d>=(c1.r+c2.r))//��Բ����
        return 0;
    if((c1.r-c2.r)>=d)//��Բ�ں�,c1��
        return acos(-1.0)*c2.r*c2.r;
    if((c2.r-c1.r)>=d)//��Բ�ں�,c2��
        return acos(-1.0)*c1.r*c1.r;
    if(c1.r<c2.r){
        swap(c1.r,c2.r);
        swap(c1.x,c2.x);
        swap(c1.y,c2.y);
    }
    angle1=acos((c1.r*c1.r+d*d-c2.r*c2.r)/(2*c1.r*d));
    angle2=acos((c2.r*c2.r+d*d-c1.r*c1.r)/(2*c2.r*d));
    //cout<<angle1<<"   "<<angle2<<endl;
    s1=angle1*c1.r*c1.r;
    s2=angle2*c2.r*c2.r;
    s3=c1.r*d*sin(angle1);
    //cout<<s1<<"   "<<s2<<"   "<<s3<<endl;
    s=s1+s2-s3;

    return s;
}

Circle a,b;

int main(){
    while(scanf("%lf%lf%lf",&a.x,&a.y,&a.r)!=EOF){
        scanf("%lf%lf%lf",&b.x,&b.y,&b.r);
        printf("%.10f\n",calArea(a,b));
    }
    return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<algorithm>
#define esp 1e-8

using namespace std;

struct Circle{
    long double x,y;
    long double r;
};

long double calArea(Circle c1, Circle c2)
{
    long double d;
    long double s,s1,s2,s3,angle1,angle2,temp;

    d=sqrt((c1.x-c2.x)*(c1.x-c2.x)+(c1.y-c2.y)*(c1.y-c2.y));
    if(d>=(c1.r+c2.r))//��Բ����
        return 0;
    if((c1.r-c2.r)>=d)//��Բ�ں�,c1��
        return acos(-1.0)*c2.r*c2.r;
    if((c2.r-c1.r)>=d)//��Բ�ں�,c2��
        return acos(-1.0)*c1.r*c1.r;
    if(c1.r<c2.r){
        swap(c1.r,c2.r);
        swap(c1.x,c2.x);
        swap(c1.y,c2.y);
    }
    angle1=acos((c1.r*c1.r+d*d-c2.r*c2.r)/(2*c1.r*d));
    angle2=acos((c2.r*c2.r+d*d-c1.r*c1.r)/(2*c2.r*d));

    s1=angle1*c1.r*c1.r;s2=angle2*c2.r*c2.r;
    s3=c1.r*d*sin(angle1);
    s=s1+s2-s3;

    return s;
}

Circle a,a1,b,b1;

int main (){
    while(cin>>a.x>>a.y>>a.r){
        cin>>b.x>>b.y>>b.r;
        cout.precision(12);
        cout<<calArea(a,b)<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
#include <iostream>
#define eps 1e-8
#define Inf 0x3f3f3f3f
#define LL long long
const double pi = acos(-1.0);
using namespace std;
struct Circle
{
    double x, y, r;
}p, q;

double dis(double ax, double ay, double bx, double by)
{
    return sqrt((ax - bx) * (ax - bx) + (ay - by) * (ay - by));
}

double solve(Circle p, Circle q)
{
    double a1, a2, area, d;
    d = dis(p.x, p.y, q.x, q.y);
    if (p.r + q.r <= d) return 0;
    if (fabs(p.r - q.r) >= d)
        return q.r * q.r * pi;
    a1 = (p.r * p.r + d * d - q.r * q.r) / (2 * p.r * d);
    a2 = (q.r * q.r + d * d - p.r * p.r) / (2 * q.r * d);
    a1 = 2 * acos(a1);
    a2 = 2 * acos(a2);
    area = p.r * p.r * (a1 - sin(a1)) / 2;
    area += q.r * q.r * (a2 - sin(a2)) / 2;
    return area;
}

int main()
{
    while (scanf("%lf%lf%lf",&p.x, &p.y, &p.r) != EOF)
    {
        scanf("%lf%lf%lf",&q.x, &q.y, &q.r);
        if (p.r < q.r) swap(p, q);
        cout.precision(12);
        cout << solve(p, q) << endl;
    }
}// simply to qualify the precision


#include <bits/stdc++.h>

#define double long double

using namespace std;

const double eps=1e-8;

const double pi=acos(-1);

double dis(int x,int y)
{
    return sqrt((double)(x*x+y*y));
}

double area(double x1,double y1,double x2,double y2,double r1,double r2)
{
    double a1,a2,Ans,d;
    d=sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
    if (r1+r2<=d)
    {
        return 0;
    }
    if (fabs(r1-r2)>=d)
    {
        Ans=pi*(r1>r2?r2:r1)*(r1>r2?r2:r1);
        return Ans;
    }
    a1 = (r1*r1 + d*d - r2*r2) / (2 * r1 * d);
    a2 = (r2*r2 + d*d - r1*r1) / (2 * r2 * d);
    a1 = 2 * acos(a1);
    a2 = 2 * acos(a2);
    Ans = r1*r1 * (a1 - sin(a1)) / 2;
    Ans = Ans + r2*r2 * (a2 - sin(a2)) / 2;
    return Ans;
}

int main ()
{
    double x1, y1, r1, x2, y2, r2;
    cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;
    cout.precision(12);
    cout<<area(x1, y1, x2, y2, r1, r2)<<endl;
    return 0;
}


#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <cctype>
#include <algorithm>
#include <cmath>
#define eps 1e-6
#define Inf 0x3f3f3f3f
#define LL long long
const double pi = acos(-1.0);
using namespace std;
struct Circle
{
    LL x, y, r;
}p, q;

double dis(LL ax, LL ay, LL bx, LL by)
{
    return sqrt(1.0 * (ax - bx) * (ax - bx) + 1.0 * (ay - by) * (ay - by));
}

double getarea(double R, double theta)
{
    return R * R * pi * theta / (2.0 * pi);
}

double solve(Circle p, double A, double B, double C, int d)
{
    double h = abs(A * p.x + B * p.y + C) / sqrt(A * A+ B * B);
    double theta =2 *  acos(h / p.r);
    if (d ==  1)return getarea(p.r , theta) - p.r * p.r * sin(theta) * 0.5;
    else return getarea(p.r, 2 * pi - theta) + p.r * p.r * sin(theta) * 0.5;
}
int check(double x, double y, double A, double B, double C)
{
    if (A * x + B * y + C < eps) return -1;
    else return 1;
}

int main()
{
    double area, A, B, C;
    while (scanf("%I64d%I64d%I64d",&p.x, &p.y, &p.r) != EOF)
    {
        scanf("%I64d%I64d%I64d",&q.x, &q.y, &q.r);
        if (p.r < q.r) swap(p, q);
        double len = dis(p.x,  p.y,  q.x, q.y);
        if ((p.r - q.r) * 1.0 >= len - eps) area = getarea(q.r , 2.0 * pi);
        else if (p.r + q.r  <= len + eps) area = 0;
        else
        {
            A = 2.0 * (q.x - p.x);
            B = 2.0 * (q.y - p.y);
            C = 1.0 * (p.x * p.x + p.y * p.y - q.x * q.x - q.y * q.y - p.r * p.r + q.r * q.r);
            //printf("%lf %lf %lf\n", A, B, C);
            if (check(q.x, q.y, A, B, C) * check(p.x, p.y, A, B, C) == -1)
            {
                area = solve(p, A, B, C, 1) + solve(q, A, B, C, 1);
            }
            else area = solve(p, A, B,C, 1) + solve(q, A, B, C, -1);
        }
        printf("%lf\n", area);
    }
    return 0;
}


#include<bits/stdc++.h>
#include <iostream>
#define eps 1e-8
#define Inf 0x3f3f3f3f
#define LL long long
const double pi = acos(-1.0);
using namespace std;
struct Circle
{
    double x, y, r;
}p, q;

double dis(double ax, double ay, double bx, double by)
{
    return sqrt((ax - bx) * (ax - bx) + (ay - by) * (ay - by));
}

double solve(Circle p, Circle q)
{
    double a1, a2, area, d;
    d = dis(p.x, p.y, q.x, q.y);
    if (p.r + q.r <= d) return 0;
    if (fabs(p.r - q.r) >= d)
        return q.r * q.r * pi;
    a1 = (p.r * p.r + d * d - q.r * q.r) / (2 * p.r * d);
    a2 = (q.r * q.r + d * d - p.r * p.r) / (2 * q.r * d);
    a1 = 2 * acos(a1);
    a2 = 2 * acos(a2);
    area = p.r * p.r * (a1 - sin(a1)) / 2;
    area += q.r * q.r * (a2 - sin(a2)) / 2;
    return area;
}

int main()
{
    while (scanf("%lf%lf%lf",&p.x, &p.y, &p.r) != EOF)
    {
        scanf("%lf%lf%lf",&q.x, &q.y, &q.r);
        if (p.r < q.r) swap(p, q);
        cout << solve(p, q) << endl;
    }
}// simply to qualify the precision


#include<bits/stdc++.h>
#include <iostream>
#define eps 1e-8
#define Inf 0x3f3f3f3f
#define double long double
const double pi = acos(-1.0);
using namespace std;
struct Circle
{
    double x, y, r;
}p, q;

double dis(double ax, double ay, double bx, double by)
{
    return sqrt((ax - bx) * (ax - bx) + (ay - by) * (ay - by));
}

double solve(Circle p, Circle q)
{
    double a1, a2, area, d;
    d = dis(p.x, p.y, q.x, q.y);
    if (p.r + q.r <= d) return 0;
    if (fabs(p.r - q.r) >= d)
        return q.r * q.r * pi;
    a1 = (p.r * p.r + d * d - q.r * q.r) / (2 * p.r * d);
    a2 = (q.r * q.r + d * d - p.r * p.r) / (2 * q.r * d);
    a1 = 2 * acos(a1);
    a2 = 2 * acos(a2);
    area = p.r * p.r * (a1 - sin(a1)) / 2;
    area += q.r * q.r * (a2 - sin(a2)) / 2;
    return area;
}

int main()
{
    cin >> p.x >> p.y >> p.r >> q.x >> q.y >> q.r;
    if (p.r < q.r) swap(p, q);
    cout.precision(12);
    cout << solve(p, q) << endl;
}// simply to qualify the precision


#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <cctype>
#include <algorithm>
#include <cmath>
#define eps 1e-6
#define Inf 0x3f3f3f3f
const double pi = acos(-1.0);
using namespace std;
struct Circle
{
    double x, y, r;
}p, q;

double dis(double ax, double ay, double bx, double by)
{
    return sqrt((ax - bx) * (ax - bx) + (ay - by) * (ay - by));
}

double getarea(double R, double theta)
{
    return R * R * pi * theta / (2.0 * pi);
}

double solve(Circle p, double A, double B, double C, int d)
{
    double h = abs(A * p.x + B * p.y + C) / sqrt(A * A+ B * B);
    double theta =2 *  acos(h / p.r);
    if (d ==  1)return getarea(p.r , theta) - p.r * p.r * sin(theta) * 0.5;
    else return getarea(p.r, 2 * pi - theta) + p.r * p.r * sin(theta) * 0.5;
}
int check(double x, double y, double A, double B, double C)
{
    if (A * x + B * y + C < eps) return -1;
    else return 1;
}

int main()
{
    double area, A, B, C;
    while (scanf("%lf%lf%lf",&p.x, &p.y, &p.r) != EOF)
    {
        scanf("%lf%lf%lf",&q.x, &q.y, &q.r);
        if (p.r < q.r) swap(p, q);
        double len = dis(p.x, p.y, q.x, q.y);
        if (p.r - q.r >= len - eps) area = getarea(q.r , 2.0 * pi);
        else if (p.r + q.r  <= len + eps) area = 0;
        else
        {
            A = 2 * (q.x - p.x);
            B = 2 * (q.y - p.y);
            C = p.x * p.x + p.y * p.y - q.x * q.x - q.y * q.y - p.r * p.r + q.r * q.r;
            //printf("%lf %lf %lf\n", A, B, C);
            if (check(q.x, q.y, A, B, C) * check(p.x, p.y, A, B, C) == -1)
            {
                area = solve(p, A, B, C, 1) + solve(q, A, B, C, 1);
            }
            else area = solve(p, A, B,C, 1) + solve(q, A, B, C, -1);
        }
        printf("%lf\n", area);
    }
    return 0;
}


#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <cctype>
#include <algorithm>
#include <cmath>
#define eps 1e-8
#define Inf 0x3f3f3f3f
#define LL long long
const double pi = acos(-1.0);
using namespace std;
struct Circle
{
    double x, y, r;
}p, q;

double dis(double ax, double ay, double bx, double by)
{
    return sqrt((ax - bx) * (ax - bx) + (ay - by) * (ay - by));
}

double solve(Circle p, Circle q)
{
    double a1, a2, area, d;
    d = dis(p.x, p.y, q.x, q.y);
    if (p.r + q.r <= d) return 0;
    if (fabs(p.r - q.r) >= d)
        return q.r * q.r * pi;
    a1 = (p.r * p.r + d * d - q.r * q.r) / (2 * p.r * d);
    a2 = (q.r * q.r + d * d - p.r * p.r) / (2 * q.r * d);
    a1 = 2 * acos(a1);
    a2 = 2 * acos(a2);
    area = p.r * p.r * (a1 - sin(a1)) / 2;
    area += q.r * q.r * (a2 - sin(a2)) / 2;
    return area;
}

int main()
{
    while (scanf("%lf%lf%lf",&p.x, &p.y, &p.r) != EOF)
    {
        scanf("%lf%lf%lf",&q.x, &q.y, &q.r);
        if (p.r < q.r) swap(p, q);
        printf("%.12lf\n",solve(p, q));
    }
}


#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <cctype>
#include <algorithm>
#include <cmath>
#define eps 1e-6
#define Inf 0x3f3f3f3f
#define LL long long
const double pi = acos(-1.0);
using namespace std;
struct Circle
{
    LL x, y, r;
}p, q;

double dis(LL ax, LL ay, LL bx, LL by)
{
    return sqrt(1.0 * (ax - bx) * (ax - bx) + 1.0 * (ay - by) * (ay - by));
}

double getarea(double R, double theta)
{
    return R * R * pi * theta / (2.0 * pi);
}

int main()
{
    double area, A, B, C;
    while (scanf("%I64d%I64d%I64d",&p.x, &p.y, &p.r) != EOF)
    {
        scanf("%I64d%I64d%I64d",&q.x, &q.y, &q.r);
        if (p.r < q.r) swap(p, q);
        double len = dis(p.x,  p.y,  q.x, q.y);
        if ((p.r - q.r) * 1.0 >= len - eps) area = getarea(q.r , 2.0 * pi);
        else if (p.r + q.r  <= len + eps) area = 0;
        else
        {
            double delta = 0.5 * (p.r * p.r + (p.x - q.x) * (p.x - q.x) + (p.y - q.y) * (p.y - q.y) - q.r * q.r) ;
            delta = delta / (p.r * len);
            delta = acos(delta);
            area = getarea(p.r, 2 * delta) - 0.5 * p.r * p.r * sin(2 * delta);
            delta = 0.5 * (q.r * q.r + (p.x - q.x) * (p.x - q.x) + (p.y - q.y) * (p.y - q.y) - p.r * p.r) ;
            delta = delta / (q.r * len);
            delta = acos(delta);
            area += getarea(q.r, 2 * delta) - 0.5 * q.r * q.r * sin(2 * delta);
        }
        printf("%lf\n", area);
    }
    return 0;
}


# define _CRT_SECURE_NO_WARNINGS

# include <iostream>
# include <math.h>
# include <stdio.h>
# include <cmath>

using namespace std;

struct circle
{
	long int x, y, r;
};

int main()
{
	circle cr1, cr2;
	cin >> cr1.x >> cr1.y >> cr1.r;
	cin >> cr2.x >> cr2.y >> cr2.r;
	long double len = sqrt((cr1.x - cr2.x)*(cr1.x - cr2.x) + (cr1.y - cr2.y)*(cr1.y - cr2.y));
	const double pi = acos(-1.0);
	cout.precision(20);
	if (len >= cr1.r + cr2.r)
	{
		cout << 0;
	}
	else
	{
		if (cr1.r >= len + cr2.r)
		{
			cout << pi * cr2.r * cr2.r;
		}
		else
		{
			if (cr2.r >= len + cr1.r)
			{
				cout << pi * cr1.r * cr1.r;
			}
			else
			{
				long double l1, l2, x, koef1, koef2, s1, s2;
				l1 = acos(((cr1.r * cr1.r) + (len * len) - (cr2.r * cr2.r)) / (2 * cr1.r * len));
				l2 = acos(((cr2.r * cr2.r) + (len * len) - (cr1.r * cr1.r)) / (2 * cr2.r * len));
				koef1 = l1 * (cr1.r * cr1.r) - cos(l1) * sin(l1) * (cr1.r * cr1.r);
				koef2 = l2 * (cr2.r * cr2.r) - cos(l2) * sin(l2) * (cr2.r * cr2.r);
				x = koef1 + koef2;
				cout << x;
			}
		}
	}
	//system("pause");
	return 0;
}


# define _CRT_SECURE_NO_WARNINGS

# include <iostream>
# include <math.h>
# include <cmath>

using namespace std;

struct circle
{
	long double x, y, r;
};

int main()
{
	circle cr1, cr2;
	cin >> cr1.x >> cr1.y >> cr1.r;
	cin >> cr2.x >> cr2.y >> cr2.r;
	long double len = sqrt((cr1.x - cr2.x)*(cr1.x - cr2.x) + (cr1.y - cr2.y)*(cr1.y - cr2.y));
	const double pi = acos(-1.0);
	cout.precision(20);
	if (len >= cr1.r + cr2.r)
	{
		cout << 0;
	}
	else
	if (cr1.r >= len + cr2.r)
	{
		cout << pi * cr2.r * cr2.r;
	}
	else
	if (cr2.r >= len + cr1.r)
	{
		cout << pi * cr1.r * cr1.r;
	}
	else
	{
		long double l1, l2, x, koef1, koef2, s1, s2;
		l1 = acos(((cr1.r * cr1.r) + (len * len) - (cr2.r * cr2.r)) / (2 * cr1.r * len));
		l2 = acos(((cr2.r * cr2.r) + (len * len) - (cr1.r * cr1.r)) / (2 * cr2.r * len));
		koef1 = l1 * (cr1.r * cr1.r) - cos(l1) * sin(l1) * (cr1.r * cr1.r);
		koef2 = l2 * (cr2.r * cr2.r) - cos(l2) * sin(l2) * (cr2.r * cr2.r);
		x = koef1 + koef2;
		cout << x;
	}
	//system("pause");
	return 0;
}


# define _CRT_SECURE_NO_WARNINGS

# include <iostream>
# include <math.h>
# include <cmath>

using namespace std;

struct circle
{
	long int x, y, r;
};

int main()
{
	circle cr1, cr2;
	cin >> cr1.x >> cr1.y >> cr1.r;
	cin >> cr2.x >> cr2.y >> cr2.r;
	long double len = sqrt((cr1.x - cr2.x)*(cr1.x - cr2.x) + (cr1.y - cr2.y)*(cr1.y - cr2.y));
	const double pi = acos(-1.0);
	cout.precision(20);
	if (len >= cr1.r + cr2.r)
	{
		cout << 0;
	}
	else
	if (cr1.r >= len + cr2.r)
	{
		cout << pi * cr2.r * cr2.r;
	}
	else
	if (cr2.r >= len + cr1.r)
	{
		cout << pi * cr1.r * cr1.r;
	}
	else
	{
		long double l1, l2, x, koef1, koef2, s1, s2;
		l1 = acos(((cr1.r * cr1.r) + (len * len) - (cr2.r * cr2.r)) / (2 * cr1.r * len));
		l2 = acos(((cr2.r * cr2.r) + (len * len) - (cr1.r * cr1.r)) / (2 * cr2.r * len));
		koef1 = l1 * (cr1.r * cr1.r) - cos(l1) * sin(l1) * (cr1.r * cr1.r);
		koef2 = l2 * (cr2.r * cr2.r) - cos(l2) * sin(l2) * (cr2.r * cr2.r);
		x = koef1 + koef2;
		cout << x;
	}
	//system("pause");
	return 0;
}


# define _CRT_SECURE_NO_WARNINGS

# include <iostream>
# include <math.h>
# include <stdio.h>
# include <cmath>

using namespace std;

struct circle
{
	int x, y, r;
};

int main()
{
	circle cr1, cr2;
	cin >> cr1.x >> cr1.y >> cr1.r;
	cin >> cr2.x >> cr2.y >> cr2.r;
	double len = sqrt((cr1.x - cr2.x)*(cr1.x - cr2.x) + (cr1.y - cr2.y)*(cr1.y - cr2.y));
	const double pi = acos(-1.0);
	cout.precision(20);
	if (len >= cr1.r + cr2.r)
	{
		cout << 0;
	}
	else
	{
		if (cr1.r == len + cr2.r)
		{
			cout << pi * cr2.r * cr2.r;
		}
		else
		{
			if (cr2.r == len + cr1.r)
			{
				cout << pi * cr1.r * cr1.r;
			}
			else
			{
				long double l1, l2, x, koef1, koef2, s1, s2;
				l1 = acos(((cr1.r * cr1.r) + (len * len) - (cr2.r * cr2.r)) / (2 * cr1.r * len));
				l2 = acos(((cr2.r * cr2.r) + (len * len) - (cr1.r * cr1.r)) / (2 * cr2.r * len));
				koef1 = l1 * (cr1.r * cr1.r) - cos(l1) * sin(l1) * (cr1.r * cr1.r);
				koef2 = l2 * (cr2.r * cr2.r) - cos(l2) * sin(l2) * (cr2.r * cr2.r);
				x = koef1 + koef2;
				cout << x;
			}
		}
	}
	//system("pause");
	return 0;
}


# define _CRT_SECURE_NO_WARNINGS

# include <iostream>
# include <math.h>
# include <cmath>

using namespace std;

struct circle
{
	long int x, y, r;
};

int main()
{
	circle cr1, cr2;
	cin >> cr1.x >> cr1.y >> cr1.r;
	cin >> cr2.x >> cr2.y >> cr2.r;
	long double len = sqrt((cr1.x - cr2.x)*(cr1.x - cr2.x) + (cr1.y - cr2.y)*(cr1.y - cr2.y));
	const double pi = acos(-1.0);
	cout.precision(20);
	if (len >= cr1.r + cr2.r)
	{
		cout << 0;
	}
	else
	{
		if (cr1.r >= len + cr2.r)
		{
			cout << pi * cr2.r * cr2.r;
		}
		else
		{
			if (cr2.r >= len + cr1.r)
			{
				cout << pi * cr1.r * cr1.r;
			}
			else
			{
				long double l1, l2, x, koef1, koef2, s1, s2;
				l1 = acos(((cr1.r * cr1.r) + (len * len) - (cr2.r * cr2.r)) / (2 * cr1.r * len));
				l2 = acos(((cr2.r * cr2.r) + (len * len) - (cr1.r * cr1.r)) / (2 * cr2.r * len));
				koef1 = l1 * (cr1.r * cr1.r) - cos(l1) * sin(l1) * (cr1.r * cr1.r);
				koef2 = l2 * (cr2.r * cr2.r) - cos(l2) * sin(l2) * (cr2.r * cr2.r);
				x = koef1 + koef2;
				cout << x;
			}
		}
	}
	//system("pause");
	return 0;
}


# define _CRT_SECURE_NO_WARNINGS

# include <iostream>
# include <math.h>
# include <stdio.h>
# include <cmath>

using namespace std;

struct circle
{
	int x, y, r;
};

int main()
{
	circle cr1, cr2;
	cin >> cr1.x >> cr1.y >> cr1.r;
	cin >> cr2.x >> cr2.y >> cr2.r;
	double len = sqrt((cr1.x - cr2.x)*(cr1.x - cr2.x) + (cr1.y - cr2.y)*(cr1.y - cr2.y));
	const double pi = acos(-1.0);
	cout.precision(20);
	if (len >= cr1.r + cr2.r)
	{
		cout << 0;
	}
	else
	{
		if (cr1.r >= len + cr2.r)
		{
			cout << pi * cr2.r * cr2.r;
		}
		else
		{
			if (cr2.r >= len + cr1.r)
			{
				cout << pi * cr1.r * cr1.r;
			}
			else
			{
				long double l1, l2, x, koef1, koef2, s1, s2;
				l1 = acos(((cr1.r * cr1.r) + (len * len) - (cr2.r * cr2.r)) / (2 * cr1.r * len));
				l2 = acos(((cr2.r * cr2.r) + (len * len) - (cr1.r * cr1.r)) / (2 * cr2.r * len));
				koef1 = l1 * (cr1.r * cr1.r) - cos(l1) * sin(l1) * (cr1.r * cr1.r);
				koef2 = l2 * (cr2.r * cr2.r) - cos(l2) * sin(l2) * (cr2.r * cr2.r);
				x = koef1 + koef2;
				cout << x;
			}
		}
	}
	//system("pause");
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define pi 3.1415926535897932
#define eps 1e-9

int is_equal(long double a, long double b)
{
    if(fabs(a-b)<eps)
        return 1;

    return 0;
}

long double get_distance(long long x1, long long y1, long long x2, long long y2)
{
    return (long double)sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2));
}

long double get_angle(long double x, long long r1, long long r2, long long x1, long long y1, long long x2, long long y2)
{
    return (long double)acos((long double)(r1*r1+(x1-x2)*(x1-x2) + (y1-y2)*(y1-y2)-r2*r2)/(2*r1*x));
}

long double get_segment(long long r, long double theta, long double x, long long r1, long long r2, long long x1, long long y1, long long x2, long long y2)
{
    return r*r*(theta - (long double)sin(theta)*(long double)(r1*r1+(x1-x2)*(x1-x2) + (y1-y2)*(y1-y2)-r2*r2)/(2*r1*x));
}

int main() {

    long long x1, y1, r1;
    long long x2, y2, r2;

    cin>>x1>>y1>>r1>>x2>>y2>>r2;

    long double x = get_distance(x1, y1, x2, y2);

    if(x+eps>=r1+r2)
    {
        printf("0.000000000000000\n");
        return 0;
    }

    if(r1+eps>=x+r2+eps || r2+eps>=x+r1)
    {
        if(r1<r2)
            cout << setprecision(16) << pi*r1*r1 << "\n";
        else
            cout << setprecision(16) << pi*r2*r2 << "\n";

        return 0;
    }

    long double theta1 = get_angle(x, r1, r2, x1, y1, x2, y2);
    long double theta2 = get_angle(x, r2, r1, x1, y1, x2, y2);

    long double seg1 = get_segment(r1, theta1, x, r1, r2, x1, y1, x2, y2);
    long double seg2 = get_segment(r2, theta2, x, r2, r1, x1, y1, x2, y2);

    cout << setprecision(16) << seg1+seg2 << "\n";

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define pi 3.1415926535897932
#define eps 1e-9

int is_equal(double a, double b)
{
    if(fabs(a-b)<eps)
        return 1;

    return 0;
}

double get_distance(long long x1, long long y1, long long x2, long long y2)
{
    return sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2));
}

double get_angle(double x, long long r1, long long r2)
{
    return acos((double)(r1*r1+x*x-r2*r2)/(2*r1*x));
}

double get_segment(long long r, double theta)
{
    return r*r*(theta - sin(theta)*cos(theta));
}

int main() {

    long long x1, y1, r1;
    long long x2, y2, r2;

    cin>>x1>>y1>>r1>>x2>>y2>>r2;

    double x = get_distance(x1, y1, x2, y2);

    if(x>=r1+r2+eps)
    {
        printf("0.000000000\n");
        return 0;
    }

    if(r1>=x+r2+eps || r2>=x+r1+eps)
    {
        if(r1<r2)
            printf("%.9lf\n", pi*r1*r1);
        else
            printf("%.9lf\n", pi*r2*r2);

        return 0;
    }

    double theta1 = get_angle(x, r1, r2);
    double theta2 = get_angle(x, r2, r1);

    double seg1 = get_segment(r1, theta1);
    double seg2 = get_segment(r2, theta2);

    printf("%.9lf\n", seg1+seg2);

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define pi 3.1415926535897932
#define eps 1e-9

int is_equal(double a, double b)
{
    if(fabs(a-b)<eps)
        return 1;

    return 0;
}

double get_distance(long long x1, long long y1, long long x2, long long y2)
{
    return sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2));
}

double get_angle(double x, long long r1, long long r2)
{
    return acos((double)(r1*r1+x*x-r2*r2)/(2*r1*x));
}

double get_segment(long long r, double theta)
{
    return r*r*(theta - sin(theta)*cos(theta));
}

int main() {

    long long x1, y1, r1;
    long long x2, y2, r2;

    cin>>x1>>y1>>r1>>x2>>y2>>r2;

    double x = get_distance(x1, y1, x2, y2);

    if(x>=r1+r2+eps)
    {
        printf("%.9lf\n", 0);
        return 0;
    }

    if(r1>=x+r2+eps || r2>=x+r1+eps)
    {
        if(r1<r2)
            printf("%.9lf\n", pi*r1*r1);
        else
            printf("%.9lf\n", pi*r2*r2);

        return 0;
    }

    double theta1 = get_angle(x, r1, r2);
    double theta2 = get_angle(x, r2, r1);

    double seg1 = get_segment(r1, theta1);
    double seg2 = get_segment(r2, theta2);

    printf("%.9lf\n", seg1+seg2);

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define pi 3.1415926535897932
#define eps 1e-9

int is_equal(double a, double b)
{
    if(fabs(a-b)<eps)
        return 1;

    return 0;
}

double get_distance(long long x1, long long y1, long long x2, long long y2)
{
    return sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2));
}

double get_angle(double x, long long r1, long long r2)
{
    return acos((double)(r1*r1+x*x-r2*r2)/(2*r1*x));
}

double get_segment(long long r, double theta, double x, long long r1, long long r2)
{
    double a = (double)(r1*r1+x*x-r2*r2)/(2*r1*x);
    double b = sqrt(1-a*a);

    return r*r*(theta - a*b);
}

int main() {

    long long x1, y1, r1;
    long long x2, y2, r2;

    cin>>x1>>y1>>r1>>x2>>y2>>r2;

    double x = get_distance(x1, y1, x2, y2);

    if(x+eps>=r1+r2)
    {
        printf("0.0000000000000000\n");
        return 0;
    }

    if(r1+eps>=x+r2+eps || r2+eps>=x+r1)
    {
        if(r1<r2)
            printf("%.16lf\n", pi*r1*r1);
        else
            printf("%.16lf\n", pi*r2*r2);

        return 0;
    }

    double theta1 = get_angle(x, r1, r2);
    double theta2 = get_angle(x, r2, r1);

    double seg1 = get_segment(r1, theta1, x, r1, r2);
    double seg2 = get_segment(r2, theta2, x, r2, r1);

    printf("%.16lf\n", seg1+seg2);

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define pi 3.1415926535897932
#define eps 1e-9

int is_equal(double a, double b)
{
    if(fabs(a-b)<eps)
        return 1;

    return 0;
}

double get_distance(long long x1, long long y1, long long x2, long long y2)
{
    return sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2));
}

double get_angle(double x, long long r1, long long r2)
{
    return acos((double)(r1*r1+x*x-r2*r2)/(2*r1*x));
}

double get_segment(long long r, double theta)
{
    return r*r*(theta - sin(theta)*cos(theta));
}

int main() {

    long long x1, y1, r1;
    long long x2, y2, r2;

    cin>>x1>>y1>>r1>>x2>>y2>>r2;

    double x = get_distance(x1, y1, x2, y2);

    if(x+eps>=r1+r2)
    {
        printf("0.000000000\n");
        return 0;
    }

    if(r1+eps>=x+r2+eps || r2+eps>=x+r1)
    {
        if(r1<r2)
            printf("%.9lf\n", pi*r1*r1);
        else
            printf("%.9lf\n", pi*r2*r2);

        return 0;
    }

    double theta1 = get_angle(x, r1, r2);
    double theta2 = get_angle(x, r2, r1);

    double seg1 = get_segment(r1, theta1);
    double seg2 = get_segment(r2, theta2);

    printf("%.9lf\n", seg1+seg2);

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define eps 1e-9
#define pi 3.141592653589793

int X1, Y1;
int X2, Y2;

double dist()
{
    return sqrt((long long)(X1-X2)*(X1-X2) + (long long)(Y1-Y2)*(Y1-Y2));
}

int intersect(int r1, int r2)
{
    if(dist() > (double)r1+r2+eps)
        return 0;

    return 1;
}

double area1(int r)
{
    double x = dist()*0.5;
    double theta = acos(x/r);

    return theta*r*r - x*r*sin(theta);
}

double segment(int r, double theta)
{
    return theta*r*r - sin(theta)*cos(theta)*r*r;
}

double area2(int r1, int r2, double x)
{
    double alpha = acos((double)((long long)r1*r1+x*x-(long long)r2*r2)/(2*r1*x));
    double beta = asin(r1*sin(alpha)/r2);

    return segment(r2, beta) - segment(r1, alpha);
}

int main() {

    int r1;
    cin>>X1>>Y1>>r1;

    int r2;
    cin>>X2>>Y2>>r2;

    if(intersect(r1, r2))
    {
        double x = dist();

        if(x>=r1+eps && x>=r2+eps)
            printf("%.10lf\n", area1(r1) + area1(r2));
        else if(r1>=x+r2+eps)
            printf("%.10lf\n", pi*r2*r2);
        else if(r2>=x+r1+eps)
            printf("%.10lf\n", pi*r1*r1);
        else
        {
            if(r1>=r2+eps)
                printf("%.10lf\n", pi*r2*r2 - area2(r1, r2, x));
            else
                printf("%.10lf\n", pi*r1*r1 - area2(r2, r1, x));
        }
    }
    else
        printf("0.0000000000\n");

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define pi 3.1415926535897932
#define eps 1e-9

int is_equal(double a, double b)
{
    if(fabs(a-b)<eps)
        return 1;

    return 0;
}

double get_distance(long long x1, long long y1, long long x2, long long y2)
{
    return sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2));
}

double get_angle(double x, long long r1, long long r2, long long x1, long long y1, long long x2, long long y2)
{
    return acos((double)(r1*r1+(x1-x2)*(x1-x2) + (y1-y2)*(y1-y2)-r2*r2)/(2*r1*x));
}

double get_segment(long long r, double theta, double x, long long r1, long long r2, long long x1, long long y1, long long x2, long long y2)
{
    return r*r*(theta - sin(theta)*(double)(r1*r1+(x1-x2)*(x1-x2) + (y1-y2)*(y1-y2)-r2*r2)/(2*r1*x));
}

int main() {

    long long x1, y1, r1;
    long long x2, y2, r2;

    cin>>x1>>y1>>r1>>x2>>y2>>r2;

    double x = get_distance(x1, y1, x2, y2);

    if(x+eps>=r1+r2)
    {
        printf("0.000000000000000\n");
        return 0;
    }

    if(r1+eps>=x+r2+eps || r2+eps>=x+r1)
    {
        if(r1<r2)
            printf("%.16lf\n", pi*r1*r1);
        else
            printf("%.16lf\n", pi*r2*r2);

        return 0;
    }

    double theta1 = get_angle(x, r1, r2, x1, y1, x2, y2);
    double theta2 = get_angle(x, r2, r1, x1, y1, x2, y2);

    double seg1 = get_segment(r1, theta1, x, r1, r2, x1, y1, x2, y2);
    double seg2 = get_segment(r2, theta2, x, r2, r1, x1, y1, x2, y2);

    printf("%.16lf\n", seg1+seg2);

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define eps 1e-9
#define pi 3.141592653589793

int X1, Y1;
int X2, Y2;

double dist()
{
    return sqrt((long long)(X1-X2)*(X1-X2) + (long long)(Y1-Y2)*(Y1-Y2));
}

int intersect(int r1, int r2)
{
    if(dist() > (double)r1+r2+eps)
        return 0;

    return 1;
}

double area1(int r)
{
    double x = dist()*0.5;
    double theta = acos(x/r);

    return theta*r*r - x*r*sin(theta);
}

double segment(int r, double theta)
{
    return theta*r*r - sin(theta)*cos(theta)*r*r;
}

double area2(int r1, int r2, double x)
{
    double alpha = acos((double)((long long)r1*r1+x*x-(long long)r2*r2)/(2*r1*x));
    double beta = asin(r1*sin(alpha)/r2);

    return segment(r2, beta) - segment(r1, alpha);
}

int main() {

    int r1;
    cin>>X1>>Y1>>r1;

    int r2;
    cin>>X2>>Y2>>r2;

    if(intersect(r1, r2))
    {
        double x = dist();

        if(x>=r1+eps && x>=r2+eps)
            printf("%.10lf\n", area1(r1) + area1(r2));
        else if(r1>=x+r2+eps)
            printf("%.10lf\n", pi*r1*r1 - pi*r2*r2);
        else if(r2>=x+r1+eps)
            printf("%.10lf\n", pi*r2*r2 - pi*r1*r1);
        else
        {
            if(r1>=r2+eps)
                printf("%.10lf\n", pi*r2*r2 - area2(r1, r2, x));
            else
                printf("%.10lf\n", pi*r1*r1 - area2(r2, r1, x));
        }
    }
    else
        printf("0.0000000000\n");

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define pi 3.1415926535897932
#define eps 1e-9

int is_equal(double a, double b)
{
    if(fabs(a-b)<eps)
        return 1;

    return 0;
}

double get_distance(long long x1, long long y1, long long x2, long long y2)
{
    return sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2));
}

double get_angle(double x, long long r1, long long r2)
{
    return acos((double)(r1*r1+x*x-r2*r2)/(2*r1*x));
}

double get_segment(long long r, double theta)
{
    return r*r*(theta - sin(theta)*cos(theta));
}

int main() {

    long long x1, y1, r1;
    long long x2, y2, r2;

    cin>>x1>>y1>>r1>>x2>>y2>>r2;

    double x = get_distance(x1, y1, x2, y2);

    if(x>r1+r2+eps)
    {
        printf("%.9lf\n", 0);
        return 0;
    }

    if(is_equal(x, 0))
    {
        if(r1<r2)
            printf("%.9lf\n", pi*r1*r1);
        else
            printf("%.9lf\n", pi*r2*r2);

        return 0;
    }

    double theta1 = get_angle(x, r1, r2);
    double theta2 = get_angle(x, r2, r1);

    double seg1 = get_segment(r1, theta1);
    double seg2 = get_segment(r2, theta2);

    printf("%.9lf\n", seg1+seg2);

    return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define PI 3.1415926535897932384626433
using namespace std ;
ld dist(ld x1,ld y1,ld x2,ld y2)
{
    return sqrtl((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
}
ld angle(ld a,ld b,ld c)
{
    return acosl((b*b+c*c-a*a)/(2*b*c));
}
int main()
{
    ld x1,y1,r1,x2,y2,r2,g1,g2,d,ang,ang1,ang2,p,q,r,s,f1,f2,c1,c2,t1,t2,arc1,arc2;
    cin >> x1 >> y1 >> r1 ;
    cin >> x2 >> y2 >> r2 ;
    d=dist(x1,y1,x2,y2);
    g1=-x1;
    g2=-x2;
    f1=-y1;
    f2=-y2;
    c1=g1*g1+f1*f1-r1*r1;
    c2=g2*g2+f2*f2-r2*r2;

    s=2*(g1*g2+f1*f2)-c1-c2;
    cout.precision(20);
    if(s==2*r1*r2 || fabsl(r2-r1)>=d)
    {
        cout << min(r1*r1,r2*r2)*PI <<endl;
        return 0;
    }
    if(s==-2*r1*r2 || r1+r2 <=d)
    {
        //c//out << r1 << "  " << r2 << "   " << d << endl;
        cout << 0.0 << endl;
        return 0;
    }
    ang=angle(d,r1,r2);
    ang1=angle(r1,d,r2);
    ang2=angle(r2,d,r1);
    p=r1*sinl(ang1);
    ld res;
    t1=0.5*r1*r1*sinl(2*ang1);
    t2=0.5*r2*r2*sinl(2*ang2);
    arc1=ang1*r1*r1;
    arc2=ang2*r2*r2;
    res=arc1+arc2-t1-t2;
    cout << res << endl;
    return 0;

}


#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define PI 3.1415926535897932384626433
using namespace std ;
ld dist(ld x1,ld y1,ld x2,ld y2)
{
    return sqrtl((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
}
ld angle(ld a,ld b,ld c)
{
    return acosl((b*b+c*c-a*a)/(2*b*c));
}
int main()
{
    ld x1,y1,r1,x2,y2,r2,g1,g2,d,ang,ang1,ang2,p,q,r,s,f1,f2,c1,c2,t1,t2,arc1,arc2;
    cin >> x1 >> y1 >> r1 ;
    cin >> x2 >> y2 >> r2 ;
    d=dist(x1,y1,x2,y2);
    g1=-x1;
    g2=-x2;
    f1=-y1;
    f2=-y2;
    c1=g1*g1+f1*f1-r1*r1;
    c2=g2*g2+f2*f2-r2*r2;

    s=2*(g1*g2+f1*f2)-c1-c2;
    cout.precision(20);
    if(s==2*r1*r2 || fabsl(r2-r1)>=d)
    {
        cout << min(r1*r1,r2*r2)*PI <<endl;
        return 0;
    }
    if(s==-2*r1*r2 || r1+r2 <=d)
    {
        cout << r1 << "  " << r2 << "   " << d << endl;
        cout << 0.0 << endl;
        return 0;
    }
    ang=angle(d,r1,r2);
    ang1=angle(r2,d,r1);
    ang2=angle(r1,d,r2);
    p=r1*sinl(ang1);
    ld res;
    t1=0.5*r1*r1*sinl(2*ang1);
    t2=0.5*r2*r2*sinl(2*ang2);
    arc1=ang1*r1*r1;
    arc2=ang2*r2*r2;
    if(ang1*2<=PI && ang2 *2 <=PI)
    res=arc1+arc2-t1-t2;
    else if(ang1*2>=PI)
    {
        res=arc1+arc2-t2;
        ang1=PI-ang1;
        t1=r1*r1*sinl(ang1)*cosl(ang1);
        res+=t1;
    }
    else
    {
        res=arc2+arc1-t1;
        ang2=PI-ang2;
        t2=r2*r2*sinl(ang2)*cosl(ang2);
        res+=t2;
    }
    cout << res << endl;
    return 0;

}


#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define PI 3.1415926535897932384626433
using namespace std ;
ld dist(ld x1,ld y1,ld x2,ld y2)
{
    return sqrtl((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
}
ld angle(ld a,ld b,ld c)
{
    return acosl((b*b+c*c-a*a)/(2*b*c));
}
int main()
{
    ld x1,y1,r1,x2,y2,r2,g1,g2,d,ang,ang1,ang2,p,q,r,s,f1,f2,c1,c2,t1,t2,arc1,arc2;
    cin >> x1 >> y1 >> r1 ;
    cin >> x2 >> y2 >> r2 ;
    d=dist(x1,y1,x2,y2);
    g1=-x1;
    g2=-x2;
    f1=-y1;
    f2=-y2;
    c1=g1*g1+f1*f1-r1*r1;
    c2=g2*g2+f2*f2-r2*r2;

    s=2*(g1*g2+f1*f2)-c1-c2;
    cout.precision(20);
    if(s==2*r1*r2 || fabsl(r2-r1)>=d)
    {
        cout << min(r1*r1,r2*r2)*PI <<endl;
        return 0;
    }
    if(s==-2*r1*r2 || r1+r2 <=d)
    {
        cout << r1 << "  " << r2 << "   " << d << endl;
        cout << 0.0 << endl;
        return 0;
    }
    ang=angle(d,r1,r2);
    ang1=angle(r1,d,r2);
    ang2=angle(r2,d,r1);
    p=r1*sinl(ang1);
    ld res;
    t1=0.5*r1*r1*sinl(2*ang1);
    t2=0.5*r2*r2*sinl(2*ang2);
    arc1=ang1*r1*r1;
    arc2=ang2*r2*r2;
    res=arc1+arc2-t1-t2;
    cout << res << endl;
    return 0;

}


#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define PI 3.1415926535897932384626433
using namespace std ;
ld dist(ld x1,ld y1,ld x2,ld y2)
{
    return sqrtl((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
}
ld angle(ld a,ld b,ld c)
{
    return acosl((b*b+c*c-a*a)/(2*b*c));
}
int main()
{
    ld x1,y1,r1,x2,y2,r2,g1,g2,d,ang,ang1,ang2,p,q,r,s,f1,f2,c1,c2,t1,t2,arc1,arc2;
    cin >> x1 >> y1 >> r1 ;
    cin >> x2 >> y2 >> r2 ;
    d=dist(x1,y1,x2,y2);
    g1=-x1;
    g2=-x2;
    f1=-y1;
    f2=-y2;
    c1=g1*g1+f1*f1-r1*r1;
    c2=g2*g2+f2*f2-r2*r2;

    s=2*(g1*g2+f1*f2)-c1-c2;
    cout.precision(20);
    if(s==2*r1*r2 || fabsl(r2-r1)>=d)
    {
        cout << min(r1*r1,r2*r2)*PI <<endl;
        return 0;
    }
    if(s==-2*r1*r2 || r1+r2 <=d)
    {
        //cout << r1 << "  " << r2 << "   " << d << endl;
        cout << 0.0 << endl;
        return 0;
    }
    ang=angle(d,r1,r2);
    ang1=angle(r2,d,r1);
    ang2=angle(r1,d,r2);
    p=r1*sinl(ang1);
    ld res;
    t1=0.5*r1*r1*sinl(2*ang1);
    t2=0.5*r2*r2*sinl(2*ang2);
    arc1=ang1*r1*r1;
    arc2=ang2*r2*r2;
    if(ang1*2<=PI && ang2 *2 <=PI)
    res=arc1+arc2-t1-t2;
    else if(ang1*2>=PI)
    {
        res=arc1+arc2-t2;
        ang1=PI-ang1;
        t1=r1*r1*sinl(ang1)*cosl(ang1);
        res+=t1;
    }
    else
    {
        res=arc2+arc1-t1;
        ang2=PI-ang2;
        t2=r2*r2*sinl(ang2)*cosl(ang2);
        res+=t2;
    }
    cout << res << endl;
    return 0;

}


#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define PI 3.1415926535897932384626433
using namespace std ;
ld dist(ld x1,ld y1,ld x2,ld y2)
{
    return sqrtl((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
}
ld angle(ld a,ld b,ld c)
{
    return acosl((b*b+c*c-a*a)/(2*b*c));
}
int main()
{
    ld x1,y1,r1,x2,y2,r2,g1,g2,d,ang,ang1,ang2,p,q,r,s,f1,f2,c1,c2,t1,t2,arc1,arc2;
    cin >> x1 >> y1 >> r1 ;
    cin >> x2 >> y2 >> r2 ;
    d=dist(x1,y1,x2,y2);
    g1=-x1;
    g2=-x2;
    f1=-y1;
    f2=-y2;
    c1=g1*g1+f1*f1-r1*r1;
    c2=g2*g2+f2*f2-r2*r2;

    s=2*(g1*g2+f1*f2)-c1-c2;
    cout.precision(20);
    if(s==2*r1*r2 || fabsl(r2-r1)>=d)
    {
        cout << min(r1*r1,r2*r2)*PI <<endl;
        return 0;
    }
    if(s==-2*r1*r2 || r1+r2 >=d)
    {
        cout << 0.0 << endl;
        return 0;
    }
    ang=angle(d,r1,r2);
    ang1=angle(r1,d,r2);
    ang2=angle(r2,d,r1);
    p=r1*sinl(ang1);
    ld res;
    t1=0.5*r1*r1*sinl(2*ang1);
    t2=0.5*r2*r2*sinl(2*ang2);
    arc1=ang1*r1*r1;
    arc2=ang2*r2*r2;
    res=arc1+arc2-t1-t2;
    cout << res << endl;
    return 0;

}


#include <iostream>
#include <cmath>
#include <iomanip>

using namespace std;

int main()
{

	long double x1, x2, y1, y2, r1, r2;

	cin>>x1>>y1>>r1;
	cin>>x2>>y2>>r2;

	long double distance = sqrt(pow(x2 - x1,2) + pow(y2 - y1, 2));

	if(distance >= r1+r2)
	{
		cout<<setprecision(20)<<0;
			return 0;
	}

	if(distance <= abs(r2-r1) && r1 >= r2)
	{
		cout<<setprecision(20)<<M_PI*pow(r2,2);
		return 0;
	}

	if(distance <= abs(r2-r1) && r2 >= r1)
	{
		cout<<setprecision(20)<<M_PI*pow(r1,2);
		return 0;
	}

	long double a = r1, b = r2, c = distance;

	long double u_cos = (long double)(b*b + c*c - a*a) / (2*b*c);
	long double theta =  2 * acos(u_cos);

	long double u1_cos = (long double)(a*a + c*c - b*b) / (2*a*c);
	long double theta1 = 2 * acos(u1_cos);

	long double segment1 = (long double)(0.5 * (r1*r1)*(theta - sin(theta)));
	long double segment2 = (long double)(0.5 * (r2*r2)*(theta1 -sin(theta1)));

	cout<<setprecision(20)<<segment1 + segment2;

	return 0;
}


#include <iostream>
#include <cmath>
#include <iomanip>

using namespace std;

#define PI 3.14159265358979323846

int main()
{

	int x1, x2, y1, y2, r1, r2;

	cin>>x1>>y1>>r1;
	cin>>x2>>y2>>r2;

	double distance = sqrt(pow(x2 - x1,2) + pow(y2 - y1, 2));

	if(distance >= r1+r2)
	{
		cout<<setprecision(20)<<0;
			return 0;
	}

	if(x1 == x2 && y1 == y2)
	{
		if(r1<=r2)
		{
			cout<<setprecision(20)<<PI*pow(r1,2);
			return 0;
		}
		else
		{
			cout<<setprecision(20)<<PI*pow(r2,2);
			return 0;
		}
	}

	double d_from_centre1 = sqrt(pow(x1,2) + pow(y1,2));
	double d_from_centre2 = sqrt(pow(x2,2) + pow(y2,2));

	if( d_from_centre1 + r1 <=  d_from_centre2 + r2)
	{
		cout<<setprecision(20)<<PI*pow(r1,2);
		return 0;
	}

	if( d_from_centre2 + r2 <=  d_from_centre1 + r1)
	{
		cout<<setprecision(20)<<PI*pow(r2,2);
		return 0;
	}

	double a = r1, b = r2, c = distance;

	double u_cos = (double)(b*b + c*c - a*a) / (2*b*c);
	double theta =  2 * acos(u_cos);

	double u1_cos = (double)(a*a + c*c - b*b) / (2*a*c);
	double theta1 = 2 * acos(u1_cos);

	double segment1 = ((r1*r1)*(theta - sin(theta))) / 2;
	double segment2 = ((r2*r2)*(theta1 - sin(theta1))) / 2;

	cout<<setprecision(20)<<segment1 + segment2;

	return 0;
}


#include <iostream>
#include <cmath>
#include <iomanip>

using namespace std;

int main()
{

	long double x1, x2, y1, y2, r1, r2;

	cin>>x1>>y1>>r1;
	cin>>x2>>y2>>r2;

	long double distance = sqrt(pow(x2 - x1,2) + pow(y2 - y1, 2));

	if(distance >= r1+r2)
	{
		cout<<setprecision(20)<<0;
			return 0;
	}

	if(distance <= abs(r2-r1) && r1 >= r2)
	{
		cout<<setprecision(20)<<M_PI*pow(r2,2);
		return 0;
	}

	if(distance <= abs(r2-r1) && r2 >= r1)
	{
		cout<<setprecision(20)<<M_PI*pow(r1,2);
		return 0;
	}

	long double a = r1, b = r2, c = distance;

	long double u_cos = (long double)(b*b + c*c - a*a) / (2*b*c);
	long double theta =  2 * acos(u_cos);

	long double u1_cos = (long double)(a*a + c*c - b*b) / (2*a*c);
	long double theta1 = 2 * acos(u1_cos);

	long double segment1 = (long double)((r1*r1)*(theta - sin(theta))) / 2;
	long double segment2 = (long double)((r2*r2)*(theta1 -sin(theta1)))/ 2;

	cout<<setprecision(20)<<segment1 + segment2;

	return 0;
}


#include <iostream>
#include <cmath>
#include <iomanip>

using namespace std;

int main()
{

	long double x1, x2, y1, y2, r1, r2;

	cin>>x1>>y1>>r1;
	cin>>x2>>y2>>r2;

	long double distance = sqrt(pow(x2 - x1,2) + pow(y2 - y1, 2));

	if(distance >= r1+r2)
	{
		cout<<setprecision(20)<<0;
			return 0;
	}

	if(distance <= abs(r2-r1) && r1 >= r2)
	{
		cout<<setprecision(20)<<M_PI*pow(r2,2);
		return 0;
	}

	if(distance <= abs(r2-r1) && r2 >= r1)
	{
		cout<<setprecision(20)<<M_PI*pow(r1,2);
		return 0;
	}

	long double a = r1, b = r2, c = distance;

	long double u_cos = (long double)(b*b + c*c - a*a) / (2*b*c);
	long double theta =  2 * acos(u_cos);

	long double u1_cos = (long double)(a*a + c*c - b*b) / (2*a*c);
	long double theta1 = 2 * acos(u1_cos);

	long double segment1 = ((r1*r1)*(theta - sin(theta))) / 2;
	long double segment2 = ((r2*r2)*(theta1 -sin(theta1)))/ 2;

	cout<<setprecision(20)<<segment1 + segment2;

	return 0;
}


#include <iostream>
#include <cmath>
#include <iomanip>

using namespace std;

int main()
{

	 double x1, x2, y1, y2, r1, r2;

	cin>>x1>>y1>>r1;
	cin>>x2>>y2>>r2;

	 double d = sqrt(pow(x2 - x1,2) + pow(y2 - y1, 2));

	if(d >= r1+r2)
	{
		cout<<setprecision(20)<<0;
			return 0;
	}

	if(d <= abs(r2-r1) && r1 >= r2)
	{
		cout<<setprecision(20)<<M_PI*pow(r2,2);
		return 0;
	}

	if(d <= abs(r2-r1) && r2 >= r1)
	{
		cout<<setprecision(20)<<M_PI*pow(r1,2);
		return 0;
	}

	 double u_cos = ( double)(r2*r2 + d*d - r1*r1) / (2*r2*d);
	 double theta =  2 * acos(u_cos);

	 double u1_cos = ( double)(r1*r1 + d*d - r2*r2) / (2*r1*d);
	 double theta1 = 2 * acos(u1_cos);

	 double s1 = ( double) 0.5*r1*r1*theta1 - 0.5*r1*r1*sin(theta1);
	 double s2 = ( double) 0.5*r2*r2*theta - 0.5*r2*r2*sin(theta);

	cout<<setprecision(20)<<s1 + s2;

	return 0;
}


#include <iostream>
#include <cmath>
#include <iomanip>

using namespace std;

# define M_PI 3.14159265358979323846

int main()
{

	long double x1, x2, y1, y2, r1, r2;

	cin>>x1>>y1>>r1;
	cin>>x2>>y2>>r2;

	long double distance = sqrt(pow(x2 - x1,2) + pow(y2 - y1, 2));

	if(distance >= r1+r2)
	{
		cout<<setprecision(20)<<0;
			return 0;
	}

	if(distance <= abs(r2-r1) && r1 >= r2)
	{
		cout<<setprecision(20)<<M_PIl*pow(r2,2);
		return 0;
	}

	if(distance <= abs(r2-r1) && r2 >= r1)
	{
		cout<<setprecision(20)<<M_PIl*pow(r1,2);
		return 0;
	}

	long double a = r1, b = r2, c = distance;

	long double u_cos = (long double)(b*b + c*c - a*a) / (2*b*c);
	long double theta =  2 * acos(u_cos);

	long double u1_cos = (long double)(a*a + c*c - b*b) / (2*a*c);
	long double theta1 = 2 * acos(u1_cos);

	long double segment1 = ((r1*r1)*(theta - sin(theta))) / 2;
	long double segment2 = ((r2*r2)*(theta1 -sin(theta1)))/ 2;

	cout<<setprecision(20)<<segment1 + segment2;

	return 0;
}


#include <iostream>
#include <cmath>
#include <math.h>
#include <iomanip>

using namespace std;

# define M_PI 3.14159265358979323846

int main()
{

	long double x1, x2, y1, y2, r1, r2;

	cin>>x1>>y1>>r1;
	cin>>x2>>y2>>r2;

	long double distance = sqrt(pow(x2 - x1,2) + pow(y2 - y1, 2));

	if(distance >= r1+r2)
	{
		cout<<setprecision(20)<<0;
			return 0;
	}

	if(distance <= abs(r2-r1) && r1 >= r2)
	{
		cout<<setprecision(20)<<M_PIl*pow(r2,2);
		return 0;
	}

	if(distance <= abs(r2-r1) && r2 >= r1)
	{
		cout<<setprecision(20)<<M_PIl*pow(r1,2);
		return 0;
	}

	long double a = r1, b = r2, c = distance;

	long double u_cos = (long double)(b*b + c*c - a*a) / (2*b*c);
	long double theta =  2 * acos(u_cos);

	long double u1_cos = (long double)(a*a + c*c - b*b) / (2*a*c);
	long double theta1 = 2 * acos(u1_cos);

	long double segment1 = ((r1*r1)*(theta - sin(theta))) / 2;
	long double segment2 = ((r2*r2)*(theta1 -sin(theta1)))/ 2;

	cout<<setprecision(20)<<segment1 + segment2;

	return 0;
}


#include <iostream>
#include <cmath>
#include <iomanip>
#include<bits/stdc++.h>

using namespace std;

int main()
{

	long double x1, x2, y1, y2, r1, r2;

	cin>>x1>>y1>>r1;
	cin>>x2>>y2>>r2;

	long double d = sqrt(pow(x2 - x1,2) + pow(y2 - y1, 2));

	if(d >= r1+r2)
	{
		cout<<setprecision(20)<<0;
			return 0;
	}

	if(d <= abs(r2-r1) && r1 >= r2)
	{
		cout<<setprecision(20)<<M_PI*pow(r2,2);
		return 0;
	}

	if(d <= abs(r2-r1) && r2 >= r1)
	{
		cout<<setprecision(20)<<M_PI*pow(r1,2);
		return 0;
	}

	long double u_cos = (long double)(r2*r2 + d*d - r1*r1) / (2*r2*d);
	long double theta =  2 * acos(u_cos);

	long double u1_cos = (long double)(r1*r1 + d*d - r2*r2) / (2*r1*d);
	long double theta1 = 2 * acos(u1_cos);

	long double s1 = (long double) 0.5*r1*r1*u1_cos - 0.5*r1*r1*sin(u1_cos);
	long double s2 = (long double) 0.5*r2*r2*u_cos - 0.5*r2*r2*sin(u_cos);

	cout<<setprecision(20)<<segment1 + segment2;

	return 0;
}


#include <iostream>
#include <cmath>
#include <iomanip>

using namespace std;

int main()
{

	long double x1, x2, y1, y2, r1, r2;

	cin>>x1>>y1>>r1;
	cin>>x2>>y2>>r2;

	long double d = sqrt(pow(x2 - x1,2) + pow(y2 - y1, 2));

	if(d >= r1+r2)
	{
		cout<<setprecision(20)<<0;
			return 0;
	}

	if(d <= abs(r2-r1) && r1 >= r2)
	{
		cout<<setprecision(20)<<M_PI*pow(r2,2);
		return 0;
	}

	if(d <= abs(r2-r1) && r2 >= r1)
	{
		cout<<setprecision(20)<<M_PI*pow(r1,2);
		return 0;
	}

	long double u_cos = (long double)(r2*r2 + d*d - r1*r1) / (2*r2*d);
	long double theta =  2 * acos(u_cos);

	long double u1_cos = (long double)(r1*r1 + d*d - r2*r2) / (2*r1*d);
	long double theta1 = 2 * acos(u1_cos);

	long double s1 = (long double) 0.5*r1*r1*theta1 - 0.5*r1*r1*sin(theta1);
	long double s2 = (long double) 0.5*r2*r2*theta - 0.5*r2*r2*sin(theta);

	cout<<setprecision(20)<<s1 + s2;

	return 0;
}


#include <iostream>
#include <cmath>
#include <iomanip>

using namespace std;

#define PI 3.14159265358979323846

int main()
{
	int x1,x2, y1, y2, r1, r2;

	cin>>x1>>y1>>r1;
	cin>>x2>>y2>>r2;

	int distance = sqrt((x2 - x1) * (x2 - x1) + (y2 - y1));

	if(distance >= r1 + r2)
		cout<<setprecision(20)<<0;
	else
	{
		if(x1 == x2 && y1 == y2)
			{
			if(r1 <= r2)
				cout<<setprecision(20)<<PI*r1*r1;
			else
				cout<<setprecision(20)<<PI*r2*r2;
			}
		else
		{

			if((x2 + r2)*(x2 + r2) == r1*r1)
				cout<<setprecision(20)<<PI*r2*r2;
			else
				if((x1 + r1)*(x1 + r1) == r2*r2)
					cout<<setprecision(20)<<PI*r2*r2;
				else
				{
						int a = r1, b = r2, c = distance;

			double u_cos = (double)(b*b + c*c - a*a) / (2*b*c);
			double theta =  2 * acos(u_cos);

			double u1_cos = (double)(a*a + c*c - b*b) / (2*a*c);
			double theta1 = 2 * acos(u1_cos);

			double segment1 = ((r1*r1)*(theta - sin(theta))) / 2;
			double segment2 = ((r2*r2)*(theta1 - sin(theta1))) / 2;

			cout<<setprecision(20)<<segment1 + segment2;
			cout<<endl<<r1<<"  & "<<r2<<endl;

			cout<<"Seg1 = "<<segment2<<endl;

			return 0;

				}
		}
	}
}


#include <iostream>
#include <cmath>
#include <iomanip>

using namespace std;

#define PI 3.14159265358979323846

int main()
{

	double x1, x2, y1, y2, r1, r2;

	cin>>x1>>y1>>r1;
	cin>>x2>>y2>>r2;

	double distance = sqrt(pow(x2 - x1,2) + pow(y2 - y1, 2));

	if(distance >= r1+r2)
	{
		cout<<setprecision(20)<<0;
			return 0;
	}

	if(x1 == x2 && y1 == y2)
	{
		if(r1<=r2)
		{
			cout<<setprecision(20)<<PI*pow(r1,2);
			return 0;
		}
		else
		{
			cout<<setprecision(20)<<PI*pow(r2,2);
			return 0;
		}
	}

	double d_from_centre1 = sqrt(pow(x1,2) + pow(y1,2));
	double d_from_centre2 = sqrt(pow(x2,2) + pow(y2,2));

	if( (d_from_centre1 + r1 <=  d_from_centre2 + r2 || d_from_centre2 + r2 <=  d_from_centre1 + r1) && (r1!=r2))
	{
		/*
		if(r1 <= r2)
		{
			cout<<setprecision(20)<<PI*pow(r1,2);
			return 0;
		}
		else
		{
			cout<<setprecision(20)<<PI*pow(r2,2);
			return 0;
		}
		*/
		double min_r = min(r1,r2);
		cout<<setprecision(20)<<PI*pow(min_r,2);
			return 0;
	}

	/*
	if( d_from_centre2 + r2 <=  d_from_centre1 + r1 && r1!= r2)
	{
		if(r1 <= r2)
		{
			cout<<setprecision(20)<<PI*pow(r1,2);
			return 0;
		}
		else
		{
			cout<<setprecision(20)<<PI*pow(r2,2);
			return 0;
		}
	}

		*/
	double a = r1, b = r2, c = distance;

	double u_cos = (double)(b*b + c*c - a*a) / (2*b*c);
	double theta =  2 * acos(u_cos);

	double u1_cos = (double)(a*a + c*c - b*b) / (2*a*c);
	double theta1 = 2 * acos(u1_cos);

	double segment1 = ((r1*r1)*(theta - sin(theta))) / 2;
	double segment2 = ((r2*r2)*(theta1 - sin(theta1))) / 2;

	cout<<setprecision(20)<<segment1 + segment2;

	return 0;
}


#include <iostream>
#include <cmath>
#include <iomanip>
#include<bits/stdc++.h>

using namespace std;

int main()
{

	long double x1, x2, y1, y2, r1, r2;

	cin>>x1>>y1>>r1;
	cin>>x2>>y2>>r2;

	long double distance = sqrt(pow(x2 - x1,2) + pow(y2 - y1, 2));

	if(distance >= r1+r2)
	{
		cout<<setprecision(20)<<0;
			return 0;
	}

	if(distance <= abs(r2-r1) && r1 >= r2)
	{
		cout<<setprecision(20)<<M_PI*pow(r2,2);
		return 0;
	}

	if(distance <= abs(r2-r1) && r2 >= r1)
	{
		cout<<setprecision(20)<<M_PI*pow(r1,2);
		return 0;
	}

	long double a = r1, b = r2, c = distance;

	long double u_cos = (long double)(b*b + c*c - a*a) / (2*b*c);
	long double theta =  2 * acos(u_cos);

	long double u1_cos = (long double)(a*a + c*c - b*b) / (2*a*c);
	long double theta1 = 2 * acos(u1_cos);

	long double segment1 = (long double)(0.5 * (r1*r1)*(theta - sin(theta)));
	long double segment2 = (long double)(0.5 * (r2*r2)*(theta1 -sin(theta1)));

	cout<<setprecision(20)<<segment1 + segment2;

	return 0;
}


#include <iostream>
#include <cmath>
#include <iomanip>

using namespace std;

#define PI 3.14159265358979323846

int main()
{
	int x1,x2, y1, y2, r1, r2;

	cin>>x1>>y1>>r1;
	cin>>x2>>y2>>r2;

	double distance = sqrt((x2 - x1) * (x2 - x1) + (y2 - y1)*(y2-y1));

	if(distance >= r1 + r2)
		{
			cout<<setprecision(20)<<0;
			return 0;
		}
	if(x1 == x2 && y1 == y2)
	{
			if(r1 <= r2)
				{
					cout<<setprecision(20)<<PI*r1*r1;
					return 0;
				}
			else
				{
					cout<<setprecision(20)<<PI*r2*r2;
					return 0;
				}
	}

			if((x2 + r2)*(x2 + r2) == r1*r1)
				{
					cout<<setprecision(20)<<PI*r2*r2;
					return 0;
				}
			else
				if((x1 + r1)*(x1 + r1) == r2*r2 && r1!=r2)
					{
						cout<<setprecision(20)<<PI*r2*r2;
						return 0;
					}
			else
			{
				double a = r1, b = r2, c = distance;

			double u_cos = (double)(b*b + c*c - a*a) / (2*b*c);
			double theta =  2 * acos(u_cos);

			double u1_cos = (double)(a*a + c*c - b*b) / (2*a*c);
			double theta1 = 2 * acos(u1_cos);

			double segment1 = ((r1*r1)*(theta - sin(theta))) / 2;
			double segment2 = ((r2*r2)*(theta1 - sin(theta1))) / 2;

			cout<<setprecision(20)<<segment1 + segment2;

			return 0;

		}
}


#include <iostream>
#include <cmath>
#include <iomanip>

using namespace std;

#define PI 3.14159265358979323846

int main()
{
	int x1,x2, y1, y2, r1, r2;

	cin>>x1>>y1>>r1;
	cin>>x2>>y2>>r2;

	double distance = sqrt((x2 - x1) * (x2 - x1) + (y2 - y1)*(y2-y1));

	if(distance >= r1 + r2)
		{
			cout<<setprecision(20)<<0;
			return 0;
		}
	if((x1 == x2 && y1 == y2) || ((x2 - x1) < (r2 - r1) &&  (y2 - y1) < (r2 - r1)))
	//{
			if(r1 <= r2)
				{
					cout<<setprecision(20)<<PI*r1*r1;
					return 0;
				}
			else
				{
					cout<<setprecision(20)<<PI*r2*r2;
					return 0;
				}
	//}

			if((x2 + r2)*(x2 + r2) == r1*r1)
				{
					cout<<setprecision(20)<<PI*r2*r2;
					return 0;
				}
			else
				if((x1 + r1)*(x1 + r1) == r2*r2 && r1!=r2)
					{
						cout<<setprecision(20)<<PI*r2*r2;
						return 0;
					}
			else
			{
				double a = r1, b = r2, c = distance;

		//	cout<<"R.ebi = "<<a<<" "<<b<<endl;
		//	cout<<"D = "<<c<<endl;

			double u_cos = (double)(b*b + c*c - a*a) / (2*b*c);
		//	if(u_cos < -1 || u_cos > 1)
		//		u_cos = fabs(PI - fabs(u_cos));

			double theta =  2 * acos(u_cos);

		//	cout<<u_cos<<endl;

			double u1_cos = (double)(a*a + c*c - b*b) / (2*a*c);
		//	if(u1_cos < -1 || u1_cos > 1)
		//		u1_cos = fabs(PI - fabs(u1_cos));

			double theta1 = 2 * acos(u1_cos);

		//	cout<<theta<<endl;
		//	cout<<u1_cos<<endl;

			double segment1 = ((r1*r1)*(theta - sin(theta))) / 2;
			double segment2 = ((r2*r2)*(theta1 - sin(theta1))) / 2;

			cout<<setprecision(20)<<(segment1 + segment2)/2;

			return 0;

		}
}


#include <iostream>
#include <cmath>
#include <iomanip>

using namespace std;

#define PI 3.14159265358979323846

int main()
{
	int x1,x2, y1, y2, r1, r2;

	cin>>x1>>y1>>r1;
	cin>>x2>>y2>>r2;

	int distance = sqrt((x2 - x1) * (x2 - x1) + (y2 - y1));

	if(distance >= r1 + r2)
		{
			cout<<setprecision(20)<<0;
			return 0;
		}
	if(x1 == x2 && y1 == y2)
	{
			if(r1 <= r2)
				{
					cout<<setprecision(20)<<PI*r1*r1;
					return 0;
				}
			else
				{
					cout<<setprecision(20)<<PI*r2*r2;
					return 0;
				}
	}

			if((x2 + r2)*(x2 + r2) == r1*r1)
				{
					cout<<setprecision(20)<<PI*r2*r2;
					return 0;
				}
			else
				if((x1 + r1)*(x1 + r1) == r2*r2 && r1!=r2)
					{
						cout<<setprecision(20)<<PI*r2*r2;
						return 0;
					}
			else
			{
				int a = r1, b = r2, c = distance;

			double u_cos = (double)(b*b + c*c - a*a) / (2*b*c);
			double theta =  2 * acos(u_cos);

			double u1_cos = (double)(a*a + c*c - b*b) / (2*a*c);
			double theta1 = 2 * acos(u1_cos);

			double segment1 = ((r1*r1)*(theta - sin(theta))) / 2;
			double segment2 = ((r2*r2)*(theta1 - sin(theta1))) / 2;

			cout<<setprecision(20)<<segment1 + segment2;

			return 0;

		}
}


#include <iostream>
#include <cmath>
#include <iomanip>

using namespace std;

#define PI 3.14159265358979323846

int main()
{
	int x1,x2, y1, y2, r1, r2;

	cin>>x1>>y1>>r1;
	cin>>x2>>y2>>r2;

	int distance = sqrt((x2 - x1) * (x2 - x1) + (y2 - y1));

	if(distance >= r1 + r2)
		cout<<setprecision(20)<<0;
	else
	{
		if(x1 == x2 && y1 == y2)
			{
			if(r1 <= r2)
				cout<<setprecision(20)<<PI*r1*r1;
			else
				cout<<setprecision(20)<<PI*r2*r2;
			}

		else
		{

			int a = r1, b = r2, c = distance;

			double u_cos = (double)(b*b + c*c - a*a) / (2*b*c);
			double theta =  2 * acos(u_cos);

			double u1_cos = (double)(a*a + c*c - b*b) / (2*a*c);
			double theta1 = 2 * acos(u1_cos);

			double segment1 = ((r1*r1)*(theta - sin(theta))) / 2;
			double segment2 = ((r2*r2)*(theta1 - sin(theta1))) / 2;

			cout<<setprecision(20)<<segment1 + segment2;

			return 0;

		}
	}
}


#include <iostream>
#include <cmath>
#include <iomanip>

using namespace std;

int main()
{

	long double x1, x2, y1, y2, r1, r2;

	cin>>x1>>y1>>r1;
	cin>>x2>>y2>>r2;

	long double distance = sqrt(pow(x2 - x1,2) + pow(y2 - y1, 2));

	if(distance >= r1+r2)
	{
		cout<<setprecision(20)<<0;
			return 0;
	}

	if(distance <= abs(r2-r1) && r1 >= r2)
	{
		cout<<setprecision(20)<<M_PIl*pow(r2,2);
		return 0;
	}

	if(distance <= abs(r2-r1) && r2 >= r1)
	{
		cout<<setprecision(20)<<M_PIl*pow(r1,2);
		return 0;
	}

	long double a = r1, b = r2, c = distance;

	long double u_cos = (long double)(b*b + c*c - a*a) / (2*b*c);
	long double theta =  2 * acos(u_cos);

	long double u1_cos = (long double)(a*a + c*c - b*b) / (2*a*c);
	long double theta1 = 2 * acos(u1_cos);

	long double segment1 = ((r1*r1)*(theta - sin(theta))) / 2;
	long double segment2 = ((r2*r2)*(theta1 -sin(theta1)))/ 2;

	cout<<setprecision(20)<<segment1 + segment2;

	return 0;
}


#include <iostream>
#include <cmath>
#include <iomanip>

using namespace std;

#define PI 3.14159265358979323846

int main()
{
	int x1,x2, y1, y2, r1, r2;

	cin>>x1>>y1>>r1;
	cin>>x2>>y2>>r2;

	double distance = sqrt((x2 - x1) * (x2 - x1) + (y2 - y1)*(y2-y1));

	if(distance >= r1 + r2)
		{
			cout<<setprecision(20)<<0;
			return 0;
		}
	if((x1 == x2 && y1 == y2) && ((x2 - x1) < (r2 - r1) && (y2 - y1) < (r2 - r1)))
	//{
			if(r1 <= r2)
				{
					cout<<setprecision(20)<<PI*r1*r1;
					return 0;
				}
			else
				{
					cout<<setprecision(20)<<PI*r2*r2;
					return 0;
				}
	//}

			if((x2 + r2)*(x2 + r2) == r1*r1)
				{
					cout<<setprecision(20)<<PI*r2*r2;
					return 0;
				}
			else
				if((x1 + r1)*(x1 + r1) == r2*r2 && r1!=r2)
					{
						cout<<setprecision(20)<<PI*r2*r2;
						return 0;
					}
			else
			{
				double a = r1, b = r2, c = distance;

		//	cout<<"R.ebi = "<<a<<" "<<b<<endl;
		//	cout<<"D = "<<c<<endl;

			double u_cos = (double)(b*b + c*c - a*a) / (2*b*c);
		//	if(u_cos < -1 || u_cos > 1)
		//		u_cos = fabs(PI - fabs(u_cos));

			double theta =  2 * acos(u_cos);

		//	cout<<u_cos<<endl;

			double u1_cos = (double)(a*a + c*c - b*b) / (2*a*c);
		//	if(u1_cos < -1 || u1_cos > 1)
		//		u1_cos = fabs(PI - fabs(u1_cos));

			double theta1 = 2 * acos(u1_cos);

		//	cout<<theta<<endl;
		//	cout<<u1_cos<<endl;

			double segment1 = ((r1*r1)*(theta - sin(theta))) / 2;
			double segment2 = ((r2*r2)*(theta1 - sin(theta1))) / 2;

			cout<<setprecision(20)<<(segment1 + segment2);

			return 0;

		}
}


#include <iostream>
#include <cmath>
#include <iomanip>

using namespace std;

#define PI 3.14159265358979323846

int main()
{
	int x1,x2, y1, y2, r1, r2;

	cin>>x1>>y1>>r1;
	cin>>x2>>y2>>r2;

	double distance = sqrt((x2 - x1) * (x2 - x1) + (y2 - y1)*(y2-y1));

	if(distance >= r1 + r2)
		{
			cout<<setprecision(20)<<0;
			return 0;
		}
	if((x1 == x2 && y1 == y2) || ((x2 - x1) < (r2 - r1) && (y2 - y1) < (r2 - r1)))
	//{
			if(r1 <= r2)
				{
					cout<<setprecision(20)<<PI*r1*r1;
					return 0;
				}
			else
				{
					cout<<setprecision(20)<<PI*r2*r2;
					return 0;
				}
	//}

			if((x2 + r2)*(x2 + r2) == r1*r1)
				{
					cout<<setprecision(20)<<PI*r2*r2;
					return 0;
				}
			else
				if((x1 + r1)*(x1 + r1) == r2*r2 && r1!=r2)
					{
						cout<<setprecision(20)<<PI*r2*r2;
						return 0;
					}
			else
			{
				double a = r1, b = r2, c = distance;

		//	cout<<"R.ebi = "<<a<<" "<<b<<endl;
		//	cout<<"D = "<<c<<endl;

			double u_cos = (double)(b*b + c*c - a*a) / (2*b*c);
		//	if(u_cos < -1 || u_cos > 1)
		//		u_cos = fabs(PI - fabs(u_cos));

			double theta =  2 * acos(u_cos);

		//	cout<<u_cos<<endl;

			double u1_cos = (double)(a*a + c*c - b*b) / (2*a*c);
		//	if(u1_cos < -1 || u1_cos > 1)
		//		u1_cos = fabs(PI - fabs(u1_cos));

			double theta1 = 2 * acos(u1_cos);

		//	cout<<theta<<endl;
		//	cout<<u1_cos<<endl;

			double segment1 = ((r1*r1)*(theta - sin(theta))) / 2;
			double segment2 = ((r2*r2)*(theta1 - sin(theta1))) / 2;

			cout<<setprecision(20)<<(segment1 + segment2);

			return 0;

		}
}


#include <iostream>
#include <cmath>
#include <iomanip>
#include<bits/stdc++.h>

using namespace std;

int main()
{

	long double x1, x2, y1, y2, r1, r2;

	cin>>x1>>y1>>r1;
	cin>>x2>>y2>>r2;

	long double d = sqrt(pow(x2 - x1,2) + pow(y2 - y1, 2));

	if(d >= r1+r2)
	{
		cout<<setprecision(20)<<0;
			return 0;
	}

	if(d <= abs(r2-r1) && r1 >= r2)
	{
		cout<<setprecision(20)<<M_PI*pow(r2,2);
		return 0;
	}

	if(d <= abs(r2-r1) && r2 >= r1)
	{
		cout<<setprecision(20)<<M_PI*pow(r1,2);
		return 0;
	}

	long double u_cos = (long double)(r2*r2 + d*d - r1*r1) / (2*r2*d);
	long double theta =  2 * acos(u_cos);

	long double u1_cos = (long double)(r1*r1 + d*d - r2*r2) / (2*r1*d);
	long double theta1 = 2 * acos(u1_cos);

	long double s1 = (long double) 0.5*r1*r1*theta1 - 0.5*r1*r1*sin(theta1);
	long double s2 = (long double) 0.5*r2*r2*theta - 0.5*r2*r2*sin(theta);

	cout<<setprecision(20)<<s1 + s2;

	return 0;
}


#include <iostream>
#include <cmath>
#include <iomanip>

using namespace std;

#define PI 3.14159265358979323846

int main()
{

	int x1, x2, y1, y2, r1, r2;

	cin>>x1>>y1>>r1;
	cin>>x2>>y2>>r2;

	double distance = sqrt(pow(x2 - x1,2) + pow(y2 - y1, 2));

	if(distance >= r1+r2)
	{
		cout<<setprecision(20)<<0;
			return 0;
	}

	if(x1 == x2 && y1 == y2)
	{
		if(r1<=r2)
		{
			cout<<setprecision(20)<<PI*pow(r1,2);
			return 0;
		}
		else
		{
			cout<<setprecision(20)<<PI*pow(r2,2);
			return 0;
		}
	}

	double d_from_centre1 = sqrt(pow(x1,2) + pow(y1,2));
	double d_from_centre2 = sqrt(pow(x2,2) + pow(y2,2));

	if( d_from_centre1 + r1 <=  d_from_centre2 + r2 && r1!=r2)
	{
		cout<<setprecision(20)<<PI*pow(r1,2);
		return 0;
	}

	if( d_from_centre2 + r2 <=  d_from_centre1 + r1 && r1!= r2)
	{
		cout<<setprecision(20)<<PI*pow(r2,2);
		return 0;
	}

	double a = r1, b = r2, c = distance;

	double u_cos = (double)(b*b + c*c - a*a) / (2*b*c);
	double theta =  2 * acos(u_cos);

	double u1_cos = (double)(a*a + c*c - b*b) / (2*a*c);
	double theta1 = 2 * acos(u1_cos);

	double segment1 = ((r1*r1)*(theta - sin(theta))) / 2;
	double segment2 = ((r2*r2)*(theta1 - sin(theta1))) / 2;

	cout<<setprecision(20)<<segment1 + segment2;

	return 0;
}


#include <iostream>
#include <cmath>
#include <iomanip>

using namespace std;

#define PI 3.14159265358979323846

int main()
{

	double x1, x2, y1, y2, r1, r2;

	cin>>x1>>y1>>r1;
	cin>>x2>>y2>>r2;

	double distance = sqrt(pow(x2 - x1,2) + pow(y2 - y1, 2));

	if(distance >= r1+r2)
	{
		cout<<setprecision(20)<<0;
			return 0;
	}

	if(x1 == x2 && y1 == y2)
	{
		if(r1<=r2)
		{
			cout<<setprecision(20)<<PI*pow(r1,2);
			return 0;
		}
		else
		{
			cout<<setprecision(20)<<PI*pow(r2,2);
			return 0;
		}
	}

	double d_from_centre1 = sqrt(pow(x1,2) + pow(y1,2));
	double d_from_centre2 = sqrt(pow(x2,2) + pow(y2,2));

	if( d_from_centre1 + r1 <=  d_from_centre2 + r2 || d_from_centre2 + r2 <=  d_from_centre1 + r1)
	{
		/*
		if(r1 <= r2)
		{
			cout<<setprecision(20)<<PI*pow(r1,2);
			return 0;
		}
		else
		{
			cout<<setprecision(20)<<PI*pow(r2,2);
			return 0;
		}
		*/
		double min_r = min(r1,r2);
		cout<<setprecision(20)<<PI*pow(min_r,2);
			return 0;
	}

	/*
	if( d_from_centre2 + r2 <=  d_from_centre1 + r1 && r1!= r2)
	{
		if(r1 <= r2)
		{
			cout<<setprecision(20)<<PI*pow(r1,2);
			return 0;
		}
		else
		{
			cout<<setprecision(20)<<PI*pow(r2,2);
			return 0;
		}
	}

		*/
	double a = r1, b = r2, c = distance;

	double u_cos = (double)(b*b + c*c - a*a) / (2*b*c);
	double theta =  2 * acos(u_cos);

	double u1_cos = (double)(a*a + c*c - b*b) / (2*a*c);
	double theta1 = 2 * acos(u1_cos);

	double segment1 = ((r1*r1)*(theta - sin(theta))) / 2;
	double segment2 = ((r2*r2)*(theta1 - sin(theta1))) / 2;

	cout<<setprecision(20)<<segment1 + segment2;

	return 0;
}


#include <iostream>
#include <cmath>
#include <iomanip>

using namespace std;

#define PI 3.14159265358979323846

int main()
{

	int x1, x2, y1, y2, r1, r2;

	cin>>x1>>y1>>r1;
	cin>>x2>>y2>>r2;

	double distance = sqrt(pow(x2 - x1,2) + pow(y2 - y1, 2));

	if(distance >= r1+r2)
	{
		cout<<setprecision(20)<<0;
			return 0;
	}

	if(x1 == x2 && y1 == y2)
	{
		if(r1<=r2)
		{
			cout<<setprecision(20)<<PI*pow(r1,2);
			return 0;
		}
		else
		{
			cout<<setprecision(20)<<PI*pow(r2,2);
			return 0;
		}
	}

	double d_from_centre1 = sqrt(pow(x1,2) + pow(y1,2));
	double d_from_centre2 = sqrt(pow(x2,2) + pow(y2,2));

	if( d_from_centre1 + r1 <=  d_from_centre2 + r2 && r1!=r2)
	{
		if(r1 <= r2)
		{
			cout<<setprecision(20)<<PI*pow(r1,2);
			return 0;
		}
		else
		{
			cout<<setprecision(20)<<PI*pow(r2,2);
			return 0;
		}
	}

	if( d_from_centre2 + r2 <=  d_from_centre1 + r1 && r1!= r2)
	{
		if(r1 <= r2)
		{
			cout<<setprecision(20)<<PI*pow(r1,2);
			return 0;
		}
		else
		{
			cout<<setprecision(20)<<PI*pow(r2,2);
			return 0;
		}
	}

	double a = r1, b = r2, c = distance;

	double u_cos = (double)(b*b + c*c - a*a) / (2*b*c);
	double theta =  2 * acos(u_cos);

	double u1_cos = (double)(a*a + c*c - b*b) / (2*a*c);
	double theta1 = 2 * acos(u1_cos);

	double segment1 = ((r1*r1)*(theta - sin(theta))) / 2;
	double segment2 = ((r2*r2)*(theta1 - sin(theta1))) / 2;

	cout<<setprecision(20)<<segment1 + segment2;

	return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
using namespace std;
const double PI = acos(-1.0);
int main()
{
    long double x1,y1,r1;
    long double x2,y2,r2;
    long double ans;
    cin>>x1>>y1>>r1>>x2>>y2>>r2;
    long double dissqr=(x1-x2)*(x1-x2)+(y1-y2)*(y1-y2);
    long double dis1=sqrt(dissqr);
    if(dis1>=r1+r2)
    {
            printf("0\n");
    }
    else if(dis1<=abs(r1-r2)){
        long double r=fminl(r1,r2);
            printf("%.20lf\n",(double)(r*r*PI));
    }
    else{
        long double angle2=acos((dissqr+r2*r2-r1*r1)/(2*dis1*r2));
        long double angle1=acos((dissqr+r1*r1-r2*r2)/(2*dis1*r1));
        long double areasqr1=r1*r1*sin(angle2*2)/2;
        long double areasqr2=r2*r2*sin(angle1*2)/2;
        long double areashan1=angle1*r1*r1;
        long double areashan2=angle2*r2*r2;
        ans=areashan1+areashan2-areasqr1-areasqr2;
        printf("%.20f\n",(double)ans);
    }
    return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
using namespace std;
const double PI = acos(-1.0);
int main()
{
    long double x1,y1,r1;
    long double x2,y2,r2;
    long double ans;
    cin>>x1>>y1>>r1>>x2>>y2>>r2;
    long double dissqr=(x1-x2)*(x1-x2)+(y1-y2)*(y1-y2);
    long double dis1=sqrt(dissqr);
    if(dis1>=r1+r2)
    {
            printf("0\n");
    }
    else if(dis1<=abs(r1-r2)){
        long double r=fminl(r1,r2)*fminl(r1,r2);
            printf("%.20lf\n",(double)(r*r*PI));
    }
    else{
        long double angle2=acos((dissqr+r2*r2-r1*r1)/(2*dis1*r2));
        long double angle1=acos((dissqr+r1*r1-r2*r2)/(2*dis1*r1));
        long double areasqr1=r1*r1*sin(angle2*2)/2;
        long double areasqr2=r2*r2*sin(angle1*2)/2;
        long double areashan1=angle1*r1*r1;
        long double areashan2=angle2*r2*r2;
        ans=areashan1+areashan2-areasqr1-areasqr2;
        printf("%.20f\n",(double)ans);
    }
    return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
using namespace std;
int main()
{
    int x1,y1,r1;
    int x2,y2,r2;
    long double ans;
    while(~scanf("%d%d%d",&x1,&y1,&r1))
    {
        scanf("%d%d%d",&x2,&y2,&r2);
        long double dissqr=(x1-x2)*(x1-x2)+(y1-y2)*(y1-y2);
        long double dis1=sqrt(dissqr);
        if(dis1>=r1+r2)
        {
            printf("0.00000000000000000000\n");
            continue;
        }
        if(dis1<=abs(r1-r2)){
            ans=fminl(r1,r2)*fminl(r1,r2)*acos(-1.0);
            printf("%.20lf\n",ans);
            continue;
        }
        long double angle2=acos((dissqr+r2*r2-r1*r1)/(2*dis1*r2));
        long double angle1=acos((dissqr+r1*r1-r2*r2)/(2*dis1*r1));
        long double areasqr=dis1*r1*sin(angle2)/2;
        long double areashan1=angle1*r1*r1/2;
        long double areashan2=angle2*r2*r2/2;
        ans=(areashan1+areashan2-areasqr)*2;
        printf("%.20f\n",(double)ans);
    }
    return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
using namespace std;
int main()
{
    int x1,y1,r1;
    int x2,y2,r2;
    long double ans;
    while(~scanf("%d%d%d",&x1,&y1,&r1))
    {
        scanf("%d%d%d",&x2,&y2,&r2);
        long double dissqr=(x1-x2)*(x1-x2)+(y1-y2)*(y1-y2);
        long double dis1=sqrt(dissqr);
        if(dis1>=r1+r2)
        {
            printf("0.00000000000000000000\n");
            continue;
        }
        if(dis1<=abs(r1-r2)){
            ans=fminl(r1,r2)*fminl(r1,r2)*acos(-1.0);
            printf("%.20lf\n",(double)ans);
            continue;
        }
        long double angle2=acos((dissqr+r2*r2-r1*r1)/(2*dis1*r2));
        long double angle1=acos((dissqr+r1*r1-r2*r2)/(2*dis1*r1));
        long double areasqr=dis1*r1*sin(angle2)/2;
        long double areashan1=angle1*r1*r1/2;
        long double areashan2=angle2*r2*r2/2;
        ans=(areashan1+areashan2-areasqr)*2;
        printf("%.20f\n",(double)ans);
    }
    return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
using namespace std;
int main()
{
    int x1,y1,r1;
    int x2,y2,r2;
    double ans;
    while(~scanf("%d%d%d",&x1,&y1,&r1))
    {
        scanf("%d%d%d",&x2,&y2,&r2);
        double dissqr=(x1-x2)*(x1-x2)+(y1-y2)*(y1-y2);
        double dis1=sqrt(dissqr);
        if(dis1>=r1+r2)
        {
            printf("0.00000000000000000000\n");
            continue;
        }
        if(dis1<=abs(r1-r2)){
            ans=min(r1,r2)*min(r1,r2)*acos(-1.0);
            printf("%.20lf\n",ans);
            continue;
        }
        double angle2=acos((dissqr+r2*r2-r1*r1)/(2*dis1*r2));
        double angle1=acos((dissqr+r1*r1-r2*r2)/(2*dis1*r1));
        double areasqr=dis1*r1*sin(angle2)/2;
        double areashan1=angle1*r1*r1/2;
        double areashan2=angle2*r2*r2/2;
        ans=(areashan1+areashan2-areasqr)*2;
        printf("%.20lf\n",ans);
    }
    return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
using namespace std;
const double PI = acos(-1.0);
int main()
{
    long double x1,y1,r1;
    long double x2,y2,r2;
    long double ans;
    cin>>x1>>y1>>r1>>x2>>y2>>r2;
    long double dissqr=(x1-x2)*(x1-x2)+(y1-y2)*(y1-y2);
    long double dis1=sqrt(dissqr);
    if(dis1>=r1+r2)
    {
            printf("0\n");
    }
    else if(dis1<=abs(r1-r2)){
        long double r=fminl(r1,r2);
            printf("%.20f\n",(double)(r*r*PI));
    }
    else{
        long double angle1=acos((dissqr+r1*r1-r2*r2)/(2*dis1*r1));
        long double angle2=acos((dissqr+r2*r2-r1*r1)/(2*dis1*r2));

        long double areasqr1=r1*r1*sin(angle1*2)/2;
        long double areasqr2=r2*r2*sin(angle2*2)/2;
        long double areashan1=angle1*r1*r1;
        long double areashan2=angle2*r2*r2;
        ans=areashan1+areashan2-areasqr1-areasqr2;
        printf("%.20f\n",(double)ans);
    }
    return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
using namespace std;
int main()
{
    int x1,y1,r1;
    int x2,y2,r2;
    double ans;
    while(~scanf("%d%d%d",&x1,&y1,&r1))
    {
        scanf("%d%d%d",&x2,&y2,&r2);
        double dissqr=(x1-x2)*(x1-x2)+(y1-y2)*(y1-y2);
        double dis1=sqrt(dissqr);
        if(dis1>=r1+r2)
        {
            printf("0.00000000000000000000\n");
            continue;
        }
        double angle2=acos((dissqr+r2*r2-r1*r1)/(2*dis1*r2));
        double angle1=acos((dissqr+r1*r1-r2*r2)/(2*dis1*r1));
        double areasqr=dis1*r1*sin(angle2)/2;
        double areashan1=angle1*r1*r1/2;
        double areashan2=angle2*r2*r2/2;
        ans=(areashan1+areashan2-areasqr)*2;
        printf("%.20lf\n",ans);
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

double masofa(double x, double y, double x1, double y1){
	return sqrt(pow(x - x1, 2.0) + pow(y - y1, 2.0));
}

double burchak(double a, double b, double c){
	return acos((b * b + c * c - a * a) / (2. * b * c));
}

int main(){
	double x1, y1, r1, x2, y2, r2;

	cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;

	double s = masofa(x1, y1, x2, y2);
	double maxr, minr;
	double yuza, alfa;
	maxr = (r1 > r2 ? r1 : r2);
	minr = (r1 < r2 ? r1 : r2);

	if(s >= (r1 + r2)){
		yuza = 0.0;
	}
	else if(s + minr <= maxr){
		yuza = acos(-1) * minr * minr;
	}
	else //if(s <= maxr)
	{
		alfa = burchak(minr, maxr, s);
		yuza = maxr * maxr * (alfa - sin(2. * alfa) / 2.);
		alfa = burchak(maxr, minr, s);
		yuza += minr * minr * (alfa - sin(2. *alfa) / 2.);
	}
	/*
	else if(s > maxr){
		alfa = burchak(minr, maxr, s);
		yuza = maxr * maxr * (alfa - cos(alfa) * sin(alfa));
		alfa = burchak(maxr, minr, s);
		yuza += minr * minr * (alfa - cos(alfa) * sin(alfa));
	}*/

	printf("%.20lf", yuza);
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

double masofa(double x, double y, double x1, double y1){
	return sqrt(pow(x - x1, 2.0) + pow(y - y1, 2.0));
}

double burchak(double a, double b, double c){
	return acos((b * b + c * c - a * a) / (2. * b * c));
}

int main(){
	double x1, y1, r1, x2, y2, r2;

	cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;

	double s = masofa(x1, y1, x2, y2);
	double maxr, minr;
	double yuza, alfa;
	maxr = (r1 > r2 ? r1 : r2);
	minr = (r1 < r2 ? r1 : r2);

	if(s >= (r1 + r2)){
		yuza = 0.0;
	}
	else if(s + minr <= maxr){
		yuza = acos(-1) * minr * minr;
	}
	else //if(s <= maxr)
	{
		alfa = burchak(minr, maxr, s);
		yuza = maxr * maxr * (alfa - cos(alfa) * sin(alfa));
		alfa = burchak(maxr, minr, s);
		yuza += minr * minr * (alfa - cos(alfa) * sin(alfa));
	}
	/*
	else if(s > maxr){
		alfa = burchak(minr, maxr, s);
		yuza = maxr * maxr * (alfa - cos(alfa) * sin(alfa));
		alfa = burchak(maxr, minr, s);
		yuza += minr * minr * (alfa - cos(alfa) * sin(alfa));
	}*/

	printf("%.20lf", yuza);
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

long double masofa(long double x, long double y, long double x1, long double y1){
	return sqrt(pow(x - x1, 2.0) + pow(y - y1, 2.0));
}

long double burchak(long double a, long double b, long double c){
	return acos((b * b + c * c - a * a) / (2. * b * c));
}

int main(){
	long double x1, y1, r1, x2, y2, r2;

	cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;

	long double s = masofa(x1, y1, x2, y2);
	long double maxr, minr;
	long double yuza, alfa;
	maxr = (r1 > r2 ? r1 : r2);
	minr = (r1 < r2 ? r1 : r2);

	if(s >= (r1 + r2)){
		yuza = 0.0;
	}
	else if(s + minr <= maxr){
		yuza = acos(-1) * minr * minr;
	}
	else //if(s <= maxr)
	{
		alfa = burchak(minr, maxr, s);
		yuza = maxr * maxr * (alfa - cos(alfa) * sin(alfa));
		alfa = burchak(maxr, minr, s);
		yuza += minr * minr * (alfa - cos(alfa) * sin(alfa));
	}
	/*
	else if(s > maxr){
		alfa = burchak(minr, maxr, s);
		yuza = maxr * maxr * (alfa - cos(alfa) * sin(alfa));
		alfa = burchak(maxr, minr, s);
		yuza += minr * minr * (alfa - cos(alfa) * sin(alfa));
	}*/

	//printf("%.5lf", yuza);
	cout << yuza;
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

double masofa(double x, double y, double x1, double y1){
	return sqrt(pow(x - x1, 2.0) + pow(y - y1, 2.0));
}

double burchak(double a, double b, double c){
	return acos((b * b + c * c - a * a) / (2. * b * c));
}

int main(){
	double x1, y1, r1, x2, y2, r2;

	cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;

	double s = masofa(x1, y1, x2, y2);
	double maxr, minr;
	double yuza, alfa;
	maxr = (r1 > r2 ? r1 : r2);
	minr = (r1 < r2 ? r1 : r2);

	if(s >= (r1 + r2)){
		yuza = 0.0;
	}
	else if(s + minr <= maxr){
		yuza = acos(-1) * minr * minr;
	}
	else //if(s <= maxr)
	{
		alfa = burchak(minr, maxr, s);
		yuza = maxr * maxr * (alfa - cos(alfa) * sin(alfa));
		alfa = burchak(maxr, minr, s);
		yuza += minr * minr * (alfa - cos(alfa) * sin(alfa));
	}
	/*
	else if(s > maxr){
		alfa = burchak(minr, maxr, s);
		yuza = maxr * maxr * (alfa - cos(alfa) * sin(alfa));
		alfa = burchak(maxr, minr, s);
		yuza += minr * minr * (alfa - cos(alfa) * sin(alfa));
	}*/

	printf("%.16lf", yuza);
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

double masofa(double x, double y, double x1, double y1){
	return sqrt(pow(x - x1, 2.0) + pow(y - y1, 2.0));
}

double burchak(double a, double b, double c){
	return acos((b * b + c * c - a * a) / (2. * b * c));
}

int main(){
	double x1, y1, r1, x2, y2, r2;

	cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;

	double s = masofa(x1, y1, x2, y2);
	double maxr, minr;
	double yuza, alfa;
	maxr = (r1 > r2 ? r1 : r2);
	minr = (r1 < r2 ? r1 : r2);

	if(s >= (r1 + r2)){
		yuza = 0.0;
	}
	else if(s + minr <= maxr){
		yuza = acos(-1) * minr * minr;
	}
	else //if(s <= maxr)
	{
		alfa = burchak(minr, maxr, s);
		double cos_a = (maxr * maxr  +(x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2) - minr * minr) / (2. * maxr * s);
		double sin_a = sqrt(1. - cos_a * cos_a);
		yuza = maxr * maxr * (alfa - cos_a * sin_a);
		alfa = burchak(maxr, minr, s);
		cos_a = ( - maxr * maxr  +(x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2) + minr * minr) / (2. * minr * s);
		sin_a = sqrt(1. - cos_a * cos_a);
		yuza += minr * minr * (alfa - cos_a * sin_a);
	}
	/*
	else if(s > maxr){
		alfa = burchak(minr, maxr, s);
		yuza = maxr * maxr * (alfa - );
		alfa = burchak(maxr, minr, s);
		yuza += minr * minr * (alfa - cos(alfa) * sin(alfa));
	}*/

	printf("%.20lf", yuza);
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

long double masofa(long double x, long double y, long double x1, long double y1){
	return sqrt(pow(x - x1, 2.0) + pow(y - y1, 2.0));
}

long double burchak(long double a, long double b, long double c){
	return acos((b * b + c * c - a * a) / (2. * b * c));
}

int main(){
	long double x1, y1, r1, x2, y2, r2;

	cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;

	long double s = masofa(x1, y1, x2, y2);
	long double maxr, minr;
	long double yuza, alfa;
	maxr = (r1 > r2 ? r1 : r2);
	minr = (r1 < r2 ? r1 : r2);

	if(s >= (r1 + r2)){
		yuza = 0.0;
	}
	else if(s + minr <= maxr){
		yuza = acos(-1) * minr * minr;
	}
	else //if(s <= maxr)
	{
		alfa = burchak(minr, maxr, s);
		yuza = maxr * maxr * (alfa - cos(alfa) * sin(alfa));
		alfa = burchak(maxr, minr, s);
		yuza += minr * minr * (alfa - cos(alfa) * sin(alfa));
	}
	/*
	else if(s > maxr){
		alfa = burchak(minr, maxr, s);
		yuza = maxr * maxr * (alfa - cos(alfa) * sin(alfa));
		alfa = burchak(maxr, minr, s);
		yuza += minr * minr * (alfa - cos(alfa) * sin(alfa));
	}*/

	//printf("%.5lf", yuza);
	cout << setprecision(30) << fixed << yuza;
	return 0;
}


#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;

int main()
{
    double x1, y1, r1, x2, y2, r2;
    cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;
    if ( r1 > r2 )
    {
        swap(x1, x2);
        swap(y1, y2);
        swap(r1, r2);
    }
    double d = sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
    double pi = acos(-1);
    double area;
    if ( r1+r2 <= d )
        area = 0;
    else if ( r2-r1 >= d )
        area = pi*pow(r1, 2);
    else
    {
        double rad1 = acos((r1*r1+d*d-r2*r2)/(2*r1*d)),
               rad2 = acos((r2*r2+d*d-r1*r1)/(2*r2*d));
        area = rad1*r1*r1-0.5*r1*r1*sin(rad1*2) + rad2*r2*r2-0.5*r2*r2*sin(rad2*2);
    }
    cout << setiosflags(ios::fixed) << setprecision(8) << area << endl;
    return 0;
}


#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;

int main()
{
    double x1, y1, r1, x2, y2, r2;
    cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;
    if ( r1 > r2 )
    {
        swap(x1, x2);
        swap(y1, y2);
        swap(r1, r2);
    }
    double d = sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
    double pi = acos(-1);
    double area;
    if ( r1+r2 <= d )
        area = 0;
    else if ( r2-r1 >= d )
        area = pi*pow(r1, 2);
    else
    {
        double rad1 = acos((r1*r1+d*d-r2*r2)/(2*r1*d)),
               rad2 = acos((r2*r2+d*d-r1*r1)/(2*r2*d));
        area = rad1*r1*r1 + rad2*r2*r2 - r1*d*sin(rad1);
    }
    cout << setprecision(8) << area << endl;
    return 0;
}


#include<stdio.h>
#include<stdlib.h>
 int cmpfunc (const void * a, const void * b)
{
   return ( *(long long int*)a - *(long long int*)b );
}
int main()
{
   long long arr[200005]={0},i,j,num=1,n;
   scanf("%lld",&n);
   for(i=0;i<n;i++)
        scanf("%lld",&arr[i]);
   qsort(arr,n,sizeof(long long int),cmpfunc);
   for(i=0;i<n;i++){

    if(num==arr[i])
        num++;
    else if(num<arr[i]){
        arr[i]=num; num++;
    }
    else if(num>arr[i])
        num=num;

   }
   printf("%lld\n",num);
   return 0;
}