#include <bits/stdc++.h>
using namespace std;
const long double pi = acos(-1.0);
int main() {
  long double x1, y1, r1, x2, y2, r2;
  while (cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2) {
    long double dis =
        sqrt(1.0 * (x1 - x2) * (x1 - x2) + 1.0 * (y1 - y2) * (y1 - y2));
    if (dis >= (r1 + r2))
      cout << "0.00000000000000000000" << endl;
    else if (dis <= fabs(r1 - r2)) {
      long double rr = min(r1, r2);
      long double ss = pi * rr * rr;
      cout << fixed << setprecision(20) << (double)ss << endl;
    } else {
      long double d = dis;
      long double alpha = acos((r1 * r1 + d * d - r2 * r2) / 2 / r1 / d);
      long double beta = acos((r2 * r2 + d * d - r1 * r1) / 2 / r2 / d);
      long double ans = (alpha * r1 * r1 - 0.5 * r1 * r1 * sin(alpha * 2)) +
                        (beta * r2 * r2 - 0.5 * r2 * r2 * sin(beta * 2));
      printf("%.20f\n", (double)ans);
    }
  }
  return 0;
}
