#include <bits/stdc++.h>
using namespace std;
template <typename T>
T nextInt() {
  T x = 0, p = 1;
  char ch;
  do {
    ch = getchar();
  } while (ch <= ' ');
  if (ch == '-') {
    p = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + (ch - '0');
    ch = getchar();
  }
  return x * p;
}
const int maxN = (int)3e5 + 10;
const int INF = (int)1e9;
const int mod = (int)1e9 + 7;
const long long LLINF = (long long)1e18;
const long double pi = acos(-1.0);
int x[2];
int y[2];
int r[2];
long double d;
long double solve(int xa, int ya, int ra, int xb, int yb, int rb) {
  long double angle =
      2 * acos((rb * 1LL * rb - ra * 1LL * ra - d * d) / (-2 * ra * d));
  return pi * ra * ra * angle / (2 * pi) - 1LL * ra * ra * sin(angle) / 2;
}
int main() {
  cin >> x[0] >> y[0] >> r[0] >> x[1] >> y[1] >> r[1];
  d = sqrtl((x[0] - x[1]) * 1LL * (x[0] - x[1]) +
            (y[0] - y[1]) * 1LL * (y[0] - y[1]));
  cout.precision(21);
  if (d >= r[0] + r[1]) {
    cout << 0 << '\n';
    return 0;
  }
  if (d <= abs(r[0] - r[1])) {
    cout << pi * min(r[0], r[1]) * min(r[0], r[1]) << '\n';
    return 0;
  }
  cout << solve(x[0], y[0], r[0], x[1], y[1], r[1]) +
              solve(x[1], y[1], r[1], x[0], y[0], r[0])
       << '\n';
  return 0;
}
