Problem: You are given two circles. Find the area of their intersection.

Input

The first line contains three integers x1, y1, r1 ( - 109 ≤ x1, y1 ≤ 109, 1 ≤ r1 ≤ 109) — the position of the center and the radius of the first circle.

The second line contains three integers x2, y2, r2 ( - 109 ≤ x2, y2 ≤ 109, 1 ≤ r2 ≤ 109) — the position of the center and the radius of the second circle.

Output

Print the area of the intersection of the circles. The answer will be considered correct if the absolute or relative error doesn't exceed 10 - 6.

Examples

Input

0 0 4
6 0 4


Output

7.25298806364175601379


Input

0 0 5
11 0 5


Output

0.00000000000000000000

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
inline long long int f(long long int idx) { return 0; }
inline long long int g(long long int val, long long int key,
                       long long int ret) {
  return (val <= key) ? ret : ret - 1;
}
inline long long int lowbound(long long int l, long long int r,
                              long long int key) {
  long long int mid, val;
  while (l < r) {
    mid = (l + r) >> 1;
    val = f(mid);
    if (key > val) {
      l = mid + 1;
    } else {
      r = mid;
    }
  }
  return g(f(l), key, l);
}
bitset<1000001> ok;
inline void seive() {
  ok.set();
  for (int i = 2; i * i < 1000001; i++)
    if (ok[i])
      for (int j = i << 1; j < 1000001; j += i) ok.reset(j);
}
long long int phi[1000001];
inline void totient() {
  for (int i = int(1); i < int(1000001); i++) phi[i] = (i & 1) ? i : i / 2;
  for (long long int i = 3; i < 1000001; i += 2)
    if (phi[i] == i)
      for (long long int j = i; j < 1000001; j += i) phi[j] -= phi[j] / i;
}
inline long long int EXP(long long int a, long long int b, long long int mod) {
  long long int res = 1;
  while (b) {
    if (b & 1) res = (res * a) % mod;
    a = (a * a) % mod;
    b >>= 1;
  }
  return res;
}
inline long long int Poww(long long int a, long long int b) {
  long long int res = 1;
  while (b) {
    if (b & 1) res = res * a;
    a = a * a;
    b >>= 1;
  }
  return res;
}
inline long long int inv(long long int x, long long int mod) {
  return EXP(x, mod - 2, mod);
}
inline long long int anyinv(long long int a, long long int mod) {
  return (ok[mod]) ? EXP(a, mod - 2, mod) : EXP(a, phi[mod] - 1, mod);
}
long long int fact[1000001];
inline void Fact() {
  fact[0] = 1;
  for (int i = int(1); i < int(1000001); i++)
    fact[i] = (i * fact[i - 1]) % 1000000007;
}
inline long long int comb(long long int a, long long int b) {
  if (a < b) return 0;
  return (((fact[a] * inv(fact[b], 1000000007)) % 1000000007) *
          inv(fact[a - b], 1000000007)) %
         1000000007;
}
long long int C[1001][1001];
inline void COMB() {
  for (int i = int(0); i < int(1001); i++) {
    C[i][0] = C[i][i] = 1;
    for (int j = int(1); j <= int(i >> 1); j++)
      C[i][j] = C[i][i - j] = (C[i - 1][j] + C[i - 1][j - 1]) % 1000000007;
  }
}
long double X1, Y1, R1, X2, Y2, R2, d, a, b;
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> X1 >> Y1 >> R1;
  cin >> X2 >> Y2 >> R2;
  d = sqrt((X2 - X1) * (X2 - X1) + (Y2 - Y1) * (Y2 - Y1));
  if (R1 < R2) swap(R1, R2);
  if (R1 + R2 <= d)
    cout << setprecision(10) << 0 << "\n";
  else if (R1 - R2 >= d)
    cout << setprecision(10) << M_PI * R2 * R2 << "\n";
  else {
    a = acos((((d * d + R1 * R1 - R2 * R2) / 2) / R1) / d);
    b = acos((((d * d + R2 * R2 - R1 * R1) / 2) / R2) / d);
    cout << setprecision(10)
         << R1 * R1 * (a - sin(a) * cos(a)) + R2 * R2 * (b - sin(b) * cos(b))
         << "\n";
  }
  return 0;
}