#include <bits/stdc++.h>
using namespace std;
const long double eps = 1e-8;
const long double pi = acos(-1.0);
struct point {
  long double x, y, r;
  point() {}
  point(long double x, long double y) : x(x), y(y) {}
  point operator-(const point& a) { return point(x - a.x, y - a.y); }
};
long double dis(point& a, point& b) {
  long double x = a.x - b.x;
  long double y = a.y - b.y;
  return sqrt(x * x + y * y);
}
long double fan(long double a) { return a * a; }
long double f(long double a, long double b, long double c) {
  return acos((fan(a) + fan(b) - fan(c)) / 2.0 / a / b);
}
void solve(point a1, point a2) {
  long double d = dis(a1, a2);
  long double alp = f(a1.r, d, a2.r) * 2;
  long double beta = f(a2.r, d, a1.r) * 2;
  long double ans = alp * fan(a1.r) / 2 - fan(a1.r) * sin(alp) / 2 +
                    (beta * fan(a2.r) / 2 - fan(a2.r) * sin(beta) / 2);
  printf("%.20lf\n", (double)ans);
}
void show(point a) { cout << a.x << ' ' << a.y << ' ' << a.r << endl; }
int main() {
  point a1, a2;
  while (cin >> a1.x >> a1.y >> a1.r) {
    cin >> a2.x >> a2.y >> a2.r;
    long double d = dis(a1, a2);
    if (d > a1.r + a2.r) {
      printf("0.00000000000\n");
    } else if (d - fabs(a1.r - a2.r) < eps) {
      long double r = min(a1.r, a2.r);
      long double ans = pi * r * r;
      printf("%.20lf\n", (double)ans);
    } else
      solve(a1, a2);
  }
  return 0;
}
