#include <bits/stdc++.h>
using namespace std;
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T>
inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}
const double EPS = 1e-10;
const double PI = acos(-1.0);
int main() {
  vector<int> x(2), y(2), r(2), R(2);
  for (int i = (0); i < (2); ++i) {
    cin >> x[i] >> y[i] >> r[i] >> R[i];
  }
  int res = 0;
  for (int i = (0); i < (2); ++i) {
    int f = i, s = (i + 1) % 2;
    double dist =
        sqrt(pow((double)x[f] - x[s], 2) + pow((double)y[f] - y[s], 2));
    if (dist + r[f] <= r[s] + EPS || dist - r[f] + EPS >= R[s] ||
        r[f] + EPS >= dist + R[s]) {
      res++;
    }
    if (dist + R[f] <= r[s] + EPS || dist - R[f] + EPS >= R[s] ||
        R[f] + EPS >= dist + R[s]) {
      res++;
    }
  }
  cout << res;
}
