#include <bits/stdc++.h>
using namespace std;
const long double pi = acosl(-1);
int n;
pair<long double, pair<long double, long double> > a, b;
void home() {}
void enter() {
  long long x, y, z;
  cin >> x >> y >> z;
  a = {x, {y, z}};
  cin >> x >> y >> z;
  b = {x, {y, z}};
  if (a.second.second > b.second.second) swap(a, b);
}
long double sq(long double num) { return num * num; }
long double tinh(long double b, long double c, long double a) {
  long double co = (b * b + c - a * a) / (2 * b * sqrt(c));
  long double goc = acosl(co);
  long double si = sinl(2 * goc);
  return sq(b) * (goc - si / 2);
}
void solve() {
  long double tam = sq(a.first - b.first) + sq(a.second.first - b.second.first);
  if (tam >= sq(a.second.second + b.second.second)) {
    cout << 0;
    return;
  }
  if (tam <= sq(b.second.second - a.second.second)) {
    cout << setprecision(8) << sq(a.second.second) * pi;
    return;
  }
  long double p1 = tinh(a.second.second, tam, b.second.second);
  long double p2 = tinh(b.second.second, tam, a.second.second);
  cout << setprecision(10) << (p1 + p2);
}
int main() {
  cout << fixed;
  home();
  enter();
  solve();
}
