#include <bits/stdc++.h>
using namespace std;
inline double min(double a, double b) { return a < b ? a : b; }
double calcHalf(int64_t r1, int64_t r2, int64_t dx, int64_t dy) {
  int64_t l2 = dx * dx + dy * dy;
  double l = sqrt(l2);
  double x = (r1 * r1 - r2 * r2 + l2) / (2.0 * l);
  double angle = 0.0;
  if (sqrt(2.0) * x < r1) {
    angle = acos(x / r1);
  } else {
    double S = sqrt(static_cast<double>((r1 + r2) * (r1 + r2) - l2) *
                    static_cast<double>(l2 - (r1 - r2) * (r1 - r2))) /
               4.0;
    double y = 2.0 * S / l;
    if (y / r1 < 0.1) {
      double c[12] = {0,   0,           0,   1.0 / 6.0,     0.0, 3.0 / 40.0,
                      0.0, 5.0 / 112.0, 0.0, 35.0 / 1152.0, 0.0, 63.0 / 2816.0};
      double vSin = 1.0;
      double sin2A = 2.0 * (y / r1) * (x / r1);
      double s = 0.0;
      for (size_t i = 0; i < 12; ++i) {
        s += vSin * c[i];
        vSin *= sin2A;
      }
      return (r1 * r1) * s / 2.0;
    }
    angle = asin(y / r1);
  }
  return (r1 * r1) * (2 * angle - sin(2 * angle)) / 2.0;
}
int main() {
  int64_t x1, y1, r1;
  int64_t x2, y2, r2;
  cin >> x1 >> y1 >> r1;
  cin >> x2 >> y2 >> r2;
  int64_t d2 = (x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1);
  if ((r1 + r2) * (r1 + r2) <= d2) {
    cout << "0.000000000" << endl;
    return 0;
  }
  if ((r1 - r2) * (r1 - r2) >= d2) {
    double s1 = M_PI * r1 * r1;
    double s2 = M_PI * r2 * r2;
    cout << setprecision(12) << min(s1, s2) << endl;
    return 0;
  }
  cout << setprecision(12)
       << calcHalf(r1, r2, x2 - x1, y2 - y1) +
              calcHalf(r2, r1, x2 - x1, y2 - y1)
       << endl;
  return 0;
}
