#include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
inline void smin(T &a, U b) {
  if (a > b) a = b;
}
template <typename T, typename U>
inline void smax(T &a, U b) {
  if (a < b) a = b;
}
template <class T>
inline void gn(T &first) {
  char c, sg = 0;
  while (c = getchar(), (c > '9' || c < '0') && c != '-')
    ;
  for ((c == '-' ? sg = 1, c = getchar() : 0), first = 0; c >= '0' && c <= '9';
       c = getchar())
    first = (first << 1) + (first << 3) + c - '0';
  if (sg) first = -first;
}
template <class T, class T1>
inline void gn(T &first, T1 &second) {
  gn(first);
  gn(second);
}
template <class T, class T1, class T2>
inline void gn(T &first, T1 &second, T2 &z) {
  gn(first);
  gn(second);
  gn(z);
}
template <class T>
inline void print(T first) {
  if (first < 0) {
    putchar('-');
    return print(-first);
  }
  if (first < 10) {
    putchar('0' + first);
    return;
  }
  print(first / 10);
  putchar(first % 10 + '0');
}
template <class T>
inline void printsp(T first) {
  print(first);
  putchar(' ');
}
template <class T>
inline void println(T first) {
  print(first);
  putchar('\n');
}
template <class T, class U>
inline void print(T first, U second) {
  printsp(first);
  println(second);
}
template <class T, class U, class V>
inline void print(T first, U second, V z) {
  printsp(first);
  printsp(second);
  println(z);
}
int power(int a, int b, int m, int ans = 1) {
  for (; b; b >>= 1, a = 1LL * a * a % m)
    if (b & 1) ans = 1LL * ans * a % m;
  return ans;
}
long double pi = acosl(-1);
struct point {
  long double first, second;
  point(long double first = 0, long double second = 0)
      : first(first), second(second) {}
  point operator-(point a) { return point(first - a.first, second - a.second); }
  point operator+(point a) { return point(first + a.first, second + a.second); }
  point operator*(long double a) { return point(first * a, second * a); }
  point operator/(long double a) { return point(first / a, second / a); }
  point operator&(point a) {
    return point(first * a.first - second * a.second,
                 first * a.second + second * a.first);
  }
  point rotate(long double al) { return *this & point(cos(al), sin(al)); }
  long double operator^(point a) { return first * a.second - second * a.first; }
  long double operator*(point a) { return first * a.first + second * a.second; }
  point norm() {
    long double s = nor();
    if (s < 1e-9) return *this;
    return point(first / s, second / s);
  }
  point conj() { return point(-second, first); }
  long double nor() { return sqrtl(*this * *this); }
  long double al() { return atan2(second, first); }
  bool operator<(const point &a) const {
    if (fabsl(first - a.first) > 1e-9) return first < a.first;
    return second < a.second - 1e-9;
  }
  bool operator>(const point &a) const {
    if (fabsl(first - a.first) > 1e-9) return first > a.first;
    return second > a.second + 1e-9;
  }
  bool operator==(const point &a) const {
    if (fabsl(first - a.first) > 1e-9) return 0;
    return fabsl(second - a.second) < 1e-9;
  }
  bool operator!=(const point &a) const {
    if (*this == a) return false;
    return true;
  }
  void input() { cin >> first >> second; }
  void print() { cout << first << ' ' << second << endl; }
};
int main() {
  cout << fixed << setprecision(9);
  point a, b;
  long double ra, rb;
  a.input();
  cin >> ra;
  b.input();
  cin >> rb;
  long double alpa, alpb;
  if (ra < rb + 1e-9) swap(a, b), swap(ra, rb);
  if ((a - b).nor() > ra + rb - 1e-9) {
    puts("0");
    return 0;
  }
  if ((b - a).nor() + rb < ra + 1e-9) {
    cout << pi * rb * rb << endl;
    return 0;
  }
  auto f = [](long double a, long double b, long double c) {
    return acosl((((a) * (a)) + ((b) * (b)) - ((c) * (c))) / (2 * a * b));
  };
  alpa = 2 * f(ra, (a - b).nor(), rb);
  alpb = 2 * f(rb, (a - b).nor(), ra);
  long double ans = (alpa - sin(alpa)) * ((ra) * (ra)) / 2 +
                    (alpb - sin(alpb)) * ((rb) * (rb)) / 2;
  cout << ans << endl;
  return 0;
}
