#include <bits/stdc++.h>
using namespace std;
const int N = 2005;
const int M = 1000005;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
long long lcm(long long a, long long b) { return a * (b / gcd(a, b)); }
long long fact(long long n) {
  long long ret = 1;
  for (int i = 1; i <= n; i++) ret *= i;
  return ret;
}
bool is_vowel(char c) {
  if (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u' || c == 'y')
    return 1;
  return 0;
}
long double getDistance(long double x1, long double y1, long double x2,
                        long double y2) {
  return sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
}
int main() {
  long long x[2], y[2], r[2];
  for (int i = 0; i < 2; i++) cin >> x[i] >> y[i] >> r[i];
  if ((x[0] - x[1]) * (x[0] - x[1]) + (y[0] - y[1]) * (y[0] - y[1]) >=
      (r[0] + r[1]) * (r[0] + r[1]))
    cout << "0.0";
  else if ((x[0] - x[1]) * (x[0] - x[1]) + (y[0] - y[1]) * (y[0] - y[1]) <=
           abs(r[0] - r[1]) * abs(r[0] - r[1])) {
    cout << setprecision(9) << acos(-1) * pow(min(r[0] * 1.0, r[1] * 1.0), 2.0);
  } else {
    long double D = getDistance(x[0] * 1.0, y[0] * 1.0, x[1] * 1.0, y[1] * 1.0);
    long double theta1 = acos((r[0] * 1.0 * r[0] + D * D - r[1] * 1.0 * r[1]) /
                              (2.0 * r[0] * D));
    long double Area1 =
        theta1 * r[0] * r[0] * 1.0 - 0.5 * r[0] * r[0] * sin(theta1 * 2.0);
    long double theta2 = acos((r[1] * 1.0 * r[1] + D * D - r[0] * 1.0 * r[0]) /
                              (2.0 * r[1] * D));
    long double Area2 =
        theta2 * r[1] * r[1] * 1.0 - 0.5 * r[1] * r[1] * sin(theta2 * 2.0);
    cout << setprecision(9) << Area1 + Area2;
  }
  return 0;
}
