#include <bits/stdc++.h>
struct circle {
  double x, y, r;
};
double dis(circle a, circle b) {
  return sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y));
}
bool canGo(circle tar, circle small, circle big) {
  if (small.r >= tar.r + dis(tar, small)) return true;
  if (big.r + tar.r <= dis(tar, big)) return true;
  if (tar.r >= big.r + dis(tar, big)) return true;
  return false;
}
int main() {
  circle ain, aout, bin, bout;
  int ret;
  double x, y, r, R;
  while (scanf("%lf%lf%lf%lf", &x, &y, &r, &R) != EOF) {
    ain.x = aout.x = x;
    ain.y = aout.y = y;
    ain.r = r;
    aout.r = R;
    scanf("%lf%lf%lf%lf", &x, &y, &r, &R);
    bin.x = bout.x = x;
    bin.y = bout.y = y;
    bin.r = r;
    bout.r = R;
    ret = 0;
    if (canGo(ain, bin, bout)) ret++;
    if (canGo(aout, bin, bout)) ret++;
    if (canGo(bin, ain, aout)) ret++;
    if (canGo(bout, ain, aout)) ret++;
    printf("%d\n", ret);
  }
  return 0;
}
