#include <bits/stdc++.h>
using namespace std;
#define inf64 INT64_MAX/2
#define inf32 INT32_MAX/2
#define int ll
#define ll long long
#define pii pair<int,int>
#define endl '\n'
#define vv vector
#define cy cout<<"Yes"<<endl
#define cn cout<<"No"<<endl
#define its(a) a.begin(),a.end()
#define minV *min_element
#define maxV *max_element
int _;
ll lcm(ll a, ll b) { return a / __gcd(a, b) * b; }
ll mpow(ll x, ll y, ll mod);
#define LD long double
#define PI 3.14159265358979323846
#define eps 1e-8
struct Point {
LD x, y;
Point(LD x, LD y) { this->x = x; this->y = y; }
Point() {}
#define line Point
Point operator+(Point b) { return Point(this->x + b.x, this->y + b.y); }
Point operator-(Point b) { return Point(this->x - b.x, this->y - b.y); }
Point operator*(LD t) { return Point(this->x * t, this->y * t); }
LD operator*(Point b) { return this->x * b.x + this->y * b.y; }
bool operator==(Point b) { return this->x == b.x && this->y == b.y; }
Point operator/(LD t) { return Point(this->x / t, this->y / t); }
};
struct Line {
Point s, e;
ll id;
bool operator==(Line b) {
return this->e == b.e && this->s == b.s;
}
};
struct Circle { Point p; LD r; };
struct Geomtry_tool {
static LD len(line a) { return sqrtl(a.x * a.x + a.y * a.y); }
LD dis(Point a, Point b) { return sqrtl((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y)); }
static LD angle(line a, line b) { return acosl(a * b / len(a) / len(b)); }
static LD cross(line a, line b) { return a.x * b.y - a.y * b.x; }
static int sgn(LD x) { return fabsl(x) <= eps ? 0 : x > 0 ? 1 : -1; }
static void zero(Point& a) { if (fabsl(a.x) <= eps)a.x = 0; if (fabsl(a.y) <= eps)a.y = 0; }
static LD cross(Point a, Point b, Point c) { return cross(b - a, c - a); }
static LD dot(Point a, Point b, Point c) { return (b - a) * (c - a); }
static bool l_S_inter(Point a, Point b, Point c, Point d) {
return sgn(cross(a, b, c) * cross(a, b, d)) <= 0;
}
static bool S_S_inter(Point a, Point b, Point c, Point d) {
return l_S_inter(a, b, c, d) && l_S_inter(c, d, a, b);
}
static Point getNode(Point a, line u, Point b, line v) {
LD t = cross((a - b), v) / cross(v, u);
return a + u * t;
}
static Point rotate(Point a, LD b) {
return { a.x * cosl(b) - a.y * sinl(b), a.x * sinl(b) + a.y * cosl(b) };
}
static LD get_S(vv<Point>& p) {
int k = p.size() - 1; LD res = 0;
for (int i = 2; i < k; i++)
res += cross((p[i] - p[1]), (p[i + 1] - p[1]));
return res / 2;
}
static Line midperp(Point a, line b) {
return { (a + b) / 2,rotate(b - a,PI / 2) };
}
bool cmp1(Point a, Point b) {
if (atan2l(a.y, a.x) != atan2l(b.y, b.x))
return atan2l(a.y, a.x) < atan2l(b.y, b.x);
else return a.x < b.x;
}
};
void solve() {
LD r1, r2;
int x, y, xx, yy;
cin >> x >> y >> r1 >> xx >> yy >> r2;
auto nd1 = Point(x, y);
auto nd2 = Point(xx, yy);
Geomtry_tool gt;
LD len_r = gt.dis(nd1, nd2);
if (len_r >= r1 + r2) {
cout << 0 << endl;
return;
}
else if (len_r <= abs(r1 - r2)) {
cout << fixed << setprecision(50) << PI * min(r1, r2) * min(r1, r2) << endl;
return;
}
LD dis = len_r;
long double a1 = acosl((r1 * r1 + dis * dis - r2 * r2) / 2 / dis / r1);
long double a2 = acosl((r2 * r2 + dis * dis - r1 * r1) / 2 / dis / r2);
LD a = (r1 * r1 + len_r * len_r - r2 * r2) / 2.0 / r1 / len_r;
LD thta1 = (LD)2 * acosl(a);
LD b = (r2 * r2 + len_r * len_r - r1 * r1) / 2.0 / r2 / len_r;
LD thta2 = (LD)2 * acosl(b);
LD trigul = r1 * len_r * sinl(thta1/2);
LD shan = thta1 * r1 * r1 / (LD)2 + thta2 * r2 * r2 / (LD)2;
LD ans = shan - trigul;
cout << fixed << setprecision(50) << ans << endl;
}
signed main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
_ = 1;
while (_--) {
solve();
}
return 0;
}
ll mpow(ll x, ll y, ll mod) {
x %= mod;
ll s = 1;
while (y) {
if (y & 1) {
s *= x;
s %= mod;
}
x *= x;
x %= mod;
y >>= 1;
}
return s;
}