#include <bits/stdc++.h>
using namespace std;
const long double pi = acos(-1.0);
const long double eps = 1e-8;
int dblcmp(long double d) {
  if (fabs(d) < eps) return 0;
  return d > eps ? 1 : -1;
}
struct Vector {
  long double x, y;
  Vector() {}
  Vector(long double a, long double b) {
    x = a;
    y = b;
  }
  Vector operator+(Vector a) { return Vector(x + a.x, y + a.y); }
  Vector operator-(Vector a) { return Vector(x - a.x, y - a.y); }
  Vector operator*(long double t) { return Vector(x * t, y * t); }
  Vector operator/(long double t) { return Vector(x / t, y / t); }
  bool operator==(Vector a) {
    return (dblcmp(a.x - x) == 0 and dblcmp(a.y - y) == 0);
  }
  long double dot(Vector a) { return (x * a.x + y * a.y); }
  long double dist() { return sqrt(dot(*this)); }
};
struct Polygon {
  vector<Vector> P;
  long double polygonArea() {
    long double ret = 0.0;
    for (long long i = 0; i < P.size() - 1; i++) {
      ret += (P[i].x * P[i + 1].y - P[i].y * P[i + 1].x);
    }
    return fabs(ret) / 2.0;
  }
};
long double circleCircleArea(Vector a, long double r1, Vector b,
                             long double r2) {
  long double c = (a - b).dist();
  if (c >= (r1 + r2)) return 0.0;
  if (c <= fabs(r1 - r2)) {
    if (r2 < r1) return pi * r2 * r2;
    return pi * r1 * r1;
  }
  long double ret = 0.0;
  long double t1 = 2.0 * (acos((r1 * r1 + c * c - r2 * r2) / (2.0 * r1 * c)));
  long double t2 = 2.0 * (acos((r2 * r2 + c * c - r1 * r1) / (2.0 * r2 * c)));
  ret += (0.5 * t1 * r1 * r1);
  ret += (0.5 * t2 * r2 * r2);
  ret -= (0.5 * r1 * r1 * sin(t1));
  ret -= (0.5 * r2 * r2 * sin(t2));
  return ret + eps;
}
int main() {
  Vector a, b;
  long double r1, r2;
  cin >> a.x >> a.y >> r1 >> b.x >> b.y >> r2;
  long double ans = circleCircleArea(a, r1, b, r2);
  cout << setprecision(25) << ans << endl;
  return 0;
}
