#include <bits/stdc++.h>
using namespace std;
double x[10], y[10], r[10], l;
double sqr(double x) { return x * x; }
bool solve(double r1, double r2, double r3) {
  return (sqr(r1 + r3) <= l || (r2 > r1 && l <= sqr(r2 - r1)) ||
          (r1 > r3 && l <= sqr(r1 - r3)));
}
int main() {
  for (int i = 0; i < 2; i++) cin >> x[i] >> y[i] >> r[i * 2] >> r[i * 2 + 1];
  l = sqr(x[0] - x[1]) + sqr(y[0] - y[1]);
  int ans = 0;
  if (solve(r[0], r[2], r[3])) ans++;
  if (solve(r[1], r[2], r[3])) ans++;
  if (solve(r[2], r[0], r[1])) ans++;
  if (solve(r[3], r[0], r[1])) ans++;
  cout << ans;
}
