#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
const int maxm = 1e5 + 10;
const int INF = 0x3f3f3f3f;
const long double pai = acos(-1.0);
struct Circle {
  long double x, y, r;
};
long double Pow2(long double k) { return k * k; }
long double Dis(Circle a, Circle b) {
  return sqrt(Pow2(a.x - b.x) + Pow2(a.y - b.y));
}
int main() {
  Circle c1, c2;
  while (cin >> c1.x >> c1.y >> c1.r >> c2.x >> c2.y >> c2.r) {
    long double d = Dis(c1, c2);
    if (c1.r + c2.r <= d)
      printf("%.20f\n", double(0));
    else if (d + c1.r <= c2.r || d + c2.r <= c1.r) {
      long double R = min(c1.r, c2.r);
      printf("%.20f\n", double(R * R * pai));
    } else {
      long double ta = acos((Pow2(c1.r) + Pow2(d) - Pow2(c2.r)) / 2 / c1.r / d);
      long double tb = acos((Pow2(c2.r) + Pow2(d) - Pow2(c1.r)) / 2 / c2.r / d);
      long double area = ta * c1.r * c1.r - 0.5 * c1.r * c1.r * sin(ta * 2);
      area += tb * c2.r * c2.r - 0.5 * c2.r * c2.r * sin(tb * 2);
      printf("%.20f\n", double(area));
    }
  }
  return 0;
}
