#include <bits/stdc++.h>
using namespace std;
struct Point {
  long double x, y;
  Point() {}
};
struct Circle {
  Circle() {}
  Point center;
  long double r;
} first_c, second_c;
long double computeDistance(Point A, Point B) {
  return sqrt((A.x - B.x) * (A.x - B.x) + (A.y - B.y) * (A.y - B.y));
}
long double computeSectorArcArea(long double r, long double angle) {
  return r * r * angle;
}
long double computeTriangleAngle(long double a, long double b, long double c) {
  long double angle = acos((b * b + c * c - a * a) / (2 * b * c));
  return angle;
}
int main() {
  cin >> first_c.center.x >> first_c.center.y >> first_c.r;
  cin >> second_c.center.x >> second_c.center.y >> second_c.r;
  long double centerLineLength =
      computeDistance(first_c.center, second_c.center);
  long double ans = 0.0;
  cout << fixed << setprecision(20);
  if (first_c.r + second_c.r - centerLineLength > 0) {
    if (abs(first_c.r - second_c.r) >= centerLineLength) {
      ans = min(
          first_c.r * first_c.r * 3.141592653589793238462643383279502884L,
          second_c.r * second_c.r * 3.141592653589793238462643383279502884L);
    } else {
      long double firstCircleAngle =
          computeTriangleAngle(second_c.r, first_c.r, centerLineLength);
      long double secondCircleAngle =
          computeTriangleAngle(first_c.r, second_c.r, centerLineLength);
      long double triangleArea = sin(firstCircleAngle) * cos(firstCircleAngle) *
                                     first_c.r * first_c.r +
                                 sin(secondCircleAngle) *
                                     cos(secondCircleAngle) * second_c.r *
                                     second_c.r;
      long double first_c_sectorArea =
          computeSectorArcArea(first_c.r, firstCircleAngle);
      long double second_c_sectorArea =
          computeSectorArcArea(second_c.r, secondCircleAngle);
      ans = second_c_sectorArea + first_c_sectorArea - triangleArea;
    }
  }
  cout << ans << endl;
  return 0;
}
