#include <bits/stdc++.h>
double dis(int x1, int y1, int x2, int y2) {
  int res = (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
  double l = sqrt(double(res));
  return l;
}
bool check(int R, int r1, int r2, double l) {
  if (l >= R + r2 || l + R <= r1 || R - l >= r2)
    return true;
  else
    return false;
}
int main() {
  int x1, y1, x2, y2, r1, R1, r2, R2;
  int i, j;
  double l;
  int ans = 0;
  scanf("%d%d%d%d%d%d%d%d", &x1, &y1, &r1, &R1, &x2, &y2, &r2, &R2);
  l = dis(x1, y1, x2, y2);
  if (check(r1, r2, R2, l)) ans++;
  if (check(R1, r2, R2, l)) ans++;
  if (check(r2, r1, R1, l)) ans++;
  if (check(R2, r1, R1, l)) ans++;
  printf("%d\n", ans);
  return 0;
}
