#include <bits/stdc++.h>
using namespace std;
long double x1, x2, y, y2, r1, r2, ab, s = 0, al, be;
const long double pi = acos(-1);
void inp() {
  cin >> x1 >> y >> r1;
  cin >> x2 >> y2 >> r2;
  ab = sqrt((x1 - x2) * (x1 - x2) + (y - y2) * (y - y2));
}
void out() {
  if (ab >= (r1 + r2)) {
    cout << fixed << setprecision(20) << s;
  } else if (ab <= abs(r1 - r2)) {
    if (r1 < r2) {
      cout << fixed << setprecision(20) << r1 * r1 * pi;
    } else {
      cout << fixed << setprecision(20) << r2 * r2 * pi;
    }
  } else {
    al = 2.0 * acos((ab * ab - r1 * r1 + r2 * r2) / (2.0 * ab * r2));
    be = 2.0 * acos((ab * ab - r2 * r2 + r1 * r1) / (2.0 * ab * r1));
    s = be * r1 * r1 - r1 * r1 * sin(be) + al * r2 * r2 - r2 * r2 * sin(al);
    s = s / 2.0;
    cout << fixed << setprecision(20) << s;
  }
}
int main() {
  inp();
  out();
  return 0;
}
