#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1);
struct cir {
  long double x, y, r;
} c1, c2;
long double area(cir x) { return PI * x.r * x.r; };
int connection() {
  long double dis =
      abs(complex<long double>(c1.x, c1.y) - complex<long double>(c2.x, c2.y));
  if (dis + c1.r <= c2.r) return 1;
  if (dis + c2.r <= c1.r) return 1;
  if (dis >= c1.r + c2.r) return 0;
  return -1;
}
long double c_area() {
  long double d =
      abs(complex<long double>(c1.x, c1.y) - complex<long double>(c2.x, c2.y));
  long double r1 = c1.r, r2 = c2.r;
  long double g1 =
      2 * acos(((r1 - r2) * (r1 + r2) + (d) * (d)) / (2.0 * r1 * d));
  long double g2 =
      2 * acos(((r2 - r1) * (r1 + r2) + (d) * (d)) / (2.0 * r2 * d));
  long double d1 = ((r1) * (r1) * (g1 - sin(g1))) / 2.0;
  long double d2 = ((r2) * (r2) * (g2 - sin(g2))) / 2.0;
  long double dd = d1 + d2;
  return dd;
}
int main() {
  cin >> c1.x >> c1.y >> c1.r;
  cin >> c2.x >> c2.y >> c2.r;
  long double ans;
  int con = connection();
  if (con == 1)
    ans = min(area(c1), area(c2));
  else if (con == 0)
    ans = 0;
  else
    ans = c_area();
  cout << setprecision(10) << ans << endl;
}
