#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7, Base = 998244353;
const long long N = 6e5 + 7;
const long long INF = 1LL * 1000 * 1000 * 1000 * 1000 * 1000 * 1000 + 7LL;
const double pie = acos(-1.0);
double x[3], y[3], r[3], R[3], d;
long long Ways;
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> x[1] >> y[1] >> r[1] >> R[1];
  cin >> x[2] >> y[2] >> r[2] >> R[2];
  d = sqrt((x[1] - x[2]) * (x[1] - x[2]) + (y[1] - y[2]) * (y[1] - y[2]));
  if (r[1] + R[2] <= d) ++Ways;
  if (d + r[1] <= r[2]) ++Ways;
  if (d + R[2] <= r[1]) ++Ways;
  if (r[2] + R[1] <= d) ++Ways;
  if (d + r[2] <= r[1]) ++Ways;
  if (d + R[1] <= r[2]) ++Ways;
  if (R[2] + d <= R[1]) ++Ways;
  if (R[1] + d <= r[2]) ++Ways;
  if (R[1] + R[2] <= d) ++Ways;
  if (R[1] + d <= R[2]) ++Ways;
  if (R[2] + d <= r[1]) ++Ways;
  if (R[1] + R[2] <= d) ++Ways;
  cout << Ways << '\n';
  return 0;
}
