#include <bits/stdc++.h>
using namespace std;
int contact(complex<double> p1, double r1, complex<double> p2, double r2) {
  double d = abs(p2 - p1);
  if (r1 + r2 < d + 1e-7) return 0;
  if (d + r2 < r1 + 1e-7) return -1;
  if (d + r1 < r2 + 1e-7) return -2;
  return 1;
}
int main() {
  double x, y;
  complex<double> p[2];
  double r[2], R[2];
  for (int i = 0; i < 2; ++i) {
    scanf("%lf%lf%lf%lf", &x, &y, &r[i], &R[i]);
    p[i] = complex<double>(x, y);
  }
  int c = 0;
  for (int i = 0; i < 2; ++i) {
    int j = 1 - i;
    double *rr = r;
    for (int k = 0; k < 2; ++k) {
      int a = contact(p[i], rr[i], p[j], r[j]);
      int b = contact(p[i], rr[i], p[j], R[j]);
      if (a != 1 && b != 1) {
        if (a == -2 || b != -2) {
          ++c;
        }
      }
      rr = R;
    }
  }
  printf("%d\n", c);
}
