#include <bits/stdc++.h>
using namespace std;
double dist;
struct circle {
  double x, y, r, R;
} a, b;
int alg(circle a, circle b) {
  int t = 0;
  if (dist >= a.R + b.R || dist + a.R <= b.r || dist + b.R <= a.R) t++;
  if (dist >= a.r + b.R || dist + a.r <= b.r || dist + b.R <= a.r) t++;
  return t;
}
int main() {
  cin >> a.x >> a.y >> a.r >> a.R >> b.x >> b.y >> b.r >> b.R;
  dist = sqrt(pow(a.x - b.x, 2) + pow(a.y - b.y, 2));
  cout << (alg(a, b) + alg(b, a));
  return 0;
}
