#include <bits/stdc++.h>
using namespace std;
long double pi = acos(0) * 2;
long double l(long double c, long double r) {
  long double w;
  w = 2 * acos(c / r);
  return w * r * r / 2 - c * r * sin(w / 2);
}
int main() {
  int q, w, e;
  long double c, c0, c1, v, v1, r, r1, t, y, ans1, ans2, ans;
  cin >> c >> v >> r;
  cin >> c1 >> v1 >> r1;
  if (r < r1) {
    t = c;
    c = c1;
    c1 = t;
    t = v;
    v = v1;
    v1 = t;
    t = r;
    r = r1;
    r1 = t;
  }
  y = sqrt((c - c1) * (c - c1) + (v - v1) * (v - v1));
  if (r >= y + r1) {
    printf("%.10f", ((double)(r1 * r1 * pi)));
    return 0;
  }
  if (y >= r + r1) {
    cout << "0";
    return 0;
  }
  c0 = (r * r + y * y - r1 * r1) / (y * 2);
  ans1 = l(c0, r);
  ans2 = l(y - c0, r1);
  if ((r1 >= y) && (r1 < y))
    ans = r1 * r1 * pi - ans1 + ans2;
  else
    ans = ans1 + ans2;
  printf("%.10f", ((double)ans));
  return 0;
}
