#include <bits/stdc++.h>
using namespace std;
long long xx1, yy1, r1, xx2, yy2, r2;
bool check() {
  long long rr = (r1 - r2) * (r1 - r2), rr2 = (r1 + r2) * (r1 + r2);
  long long xx = (xx1 - xx2) * (xx1 - xx2) + (yy1 - yy2) * (yy1 - yy2);
  return (rr < xx) && (xx <= rr2);
}
int main(int argc, char const* argv[]) {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> xx1 >> yy1 >> r1 >> xx2 >> yy2 >> r2;
  if (check()) {
    long double R, r;
    long double rr0 = (long double)r1 * r1;
    long double rr1 = (long double)r2 * r2;
    long double d = sqrt(
        (long double)((xx2 - xx1) * (xx2 - xx1) + (yy2 - yy1) * (yy2 - yy1)));
    long double dd = (xx2 - xx1) * (xx2 - xx1) + (yy2 - yy1) * (yy2 - yy1);
    long double phi =
        (acos((rr0 + dd - rr1) / ((long double)2.0 * r1 * d))) * 2.0;
    long double theta =
        (acos((rr1 + dd - rr0) / ((long double)2.0 * r2 * d))) * 2.0;
    long double area1 =
        (long double)0.5 * theta * rr1 - (long double)0.5 * rr1 * sin(theta);
    long double area2 =
        (long double)0.5 * phi * rr0 - (long double)0.5 * rr0 * sin(phi);
    long double A = area1 + area2;
    if (isnan(A))
      cout << "0.00000000000000000000\n";
    else
      cout << fixed << setprecision(20) << A << endl;
  } else {
    long long rr = (r1 - r2) * (r1 - r2), rr2 = (r1 + r2) * (r1 + r2);
    long long xx = (xx1 - xx2) * (xx1 - xx2) + (yy1 - yy2) * (yy1 - yy2);
    if (xx <= rr) {
      if (r1 < r2)
        cout << fixed << setprecision(20) << acos(-1) * r1 * r1 << endl;
      else
        cout << fixed << setprecision(20) << acos(-1) * r2 * r2 << endl;
    } else
      cout << "0.00000000000000000000\n";
  }
  return 0;
}
