#include <bits/stdc++.h>
using namespace std;
const long double pi = acos(-1.0);
double x, y, r, X, Y, R;
long double d;
long double work(long double x, long double y, long double r, long double R) {
  long double theta = acos((r * r + d * d - R * R) / (2 * r * d));
  long double tmp = theta - sin(theta) * cos(theta);
  return tmp * r * r;
}
int main() {
  cin >> x >> y >> r >> X >> Y >> R;
  d = sqrt(1.0 * (X - x) * (X - x) + 1.0 * (Y - y) * (Y - y));
  long double area = 0;
  if (r + R < d) {
  } else if (r + d <= R) {
    area = pi * r * r;
  } else if (R + d <= r) {
    area = pi * R * R;
  } else if (d == 0) {
    area = pi * r * r;
  } else {
    area += work(x, y, r, R);
    area += work(X, Y, R, r);
  }
  cout.precision(9);
  cout << area << endl;
}
