#include <bits/stdc++.h>
using namespace std;
int main() {
  long double x1, x2, y1, y2, r1, r2;
  cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;
  long double d = sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
  if (d >= r1 + r2) {
    cout << "0.00000000000000000000" << endl;
    return 0;
  }
  if (d == 0) {
    cout << fixed << setprecision(20);
    cout << acos(-1) * pow(min(r1, r2), 2) << endl;
    return 0;
  }
  if (d + min(r1, r2) <= max(r1, r2)) {
    cout << fixed << setprecision(20);
    cout << acos(-1) * pow(min(r1, r2), 2);
    return 0;
  }
  long double x = ((r1 * r1) - (r2 * r2) + (d * d)) / (2 * d);
  long double a = d - r2;
  long double b = x;
  long double r = r2;
  long double A2 =
      (r * r) *
      (asin((b - d) / r) - asin((a - d) / r) +
       .5 * (sin(2 * asin((b - d) / r)) - sin(2 * asin((a - d) / r))));
  a = b;
  b = r1;
  r = r1;
  d = 0;
  long double A1 =
      (r * r) *
      (asin((b - d) / r) - asin((a - d) / r) +
       .5 * (sin(2 * asin((b - d) / r)) - sin(2 * asin((a - d) / r))));
  cout << fixed << setprecision(20);
  cout << A1 + A2 << endl;
  return 0;
}
