#include <bits/stdc++.h>
typedef struct {
  long long x, y, r;
} circle;
int main() {
  circle a, b;
  long long dsq;
  long double d, al, cos_al, be, cos_be, out;
  std::cin >> a.x >> a.y >> a.r;
  std::cin >> b.x >> b.y >> b.r;
  dsq = (a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y);
  d = sqrt(dsq);
  if ((a.r - b.r) * (a.r - b.r) >= dsq)
    out = acosl(-1) * std::min(a.r, b.r) * std::min(a.r, b.r);
  else if (dsq >= (a.r + b.r) * (a.r + b.r))
    out = 0;
  else {
    cos_al = (b.r * b.r - a.r * a.r + dsq) / (b.r * 2 * d);
    al = acosl(cos_al);
    out = (b.r * b.r) * (al - cosl(al) * sinl(al));
    cos_be = (a.r * a.r - b.r * b.r + dsq) / (a.r * 2 * d);
    be = acosl(cos_be);
    out += (a.r * a.r) * (be - cosl(be) * sinl(be));
  }
  std::cout << std::setprecision(15) << out;
}
