#include <bits/stdc++.h>
using namespace std;
class Circle {
 public:
  complex<long double> c;
  long double r;
  Circle() {}
  Circle(complex<long double> cc, long double rr) {
    c = cc;
    r = rr;
  }
};
long double add(long double a, long double b) {
  if (fabs(a + b) < 1e-9 * (fabs(a) + fabs(b))) return 0.0;
  return a + b;
}
long double solve(Circle c1, Circle c2) {
  long double d = abs(c1.c - c2.c);
  long double alpha =
      acos((c2.r * c2.r + d * d - c1.r * c1.r) / (2.0 * c2.r * d));
  long double s = alpha * c2.r * c2.r;
  long double t = c2.r * c2.r * sin(alpha) * cos(alpha);
  swap(c1, c2);
  d = abs(c1.c - c2.c);
  alpha = acos((c2.r * c2.r + d * d - c1.r * c1.r) / (2.0 * c2.r * d));
  s = add(s, alpha * c2.r * c2.r);
  t = add(t, c2.r * c2.r * sin(alpha) * cos(alpha));
  return s - t;
}
int main(void) {
  Circle a, b;
  long double x, y, r;
  cin >> x >> y >> r;
  a = Circle(complex<long double>(x, y), r);
  cin >> x >> y >> r;
  b = Circle(complex<long double>(x, y), r);
  long double d = abs(a.c - b.c);
  if (d + 1e-9 >= a.r + b.r)
    printf("0.0000000\n");
  else if (d <= max(add(a.r, -b.r), add(b.r, -a.r)) + 1e-9)
    printf("%.20f\n", (double)min(a.r * a.r * M_PI, b.r * b.r * M_PI));
  else {
    printf("%.20f\n", (double)solve(a, b));
  }
  return 0;
}
