#include <bits/stdc++.h>
using namespace std;
double d;
int check(double a, double b, double c) {
  if (a + c <= d || a + d <= b || d + c <= a)
    return 1;
  else
    return 0;
}
int main() {
  double x1, y1, r1, R1;
  cin >> x1 >> y1 >> r1 >> R1;
  double x2, y2, r2, R2;
  cin >> x2 >> y2 >> r2 >> R2;
  d = sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
  int ans = 0;
  ans = check(r1, r2, R2) + check(R1, r2, R2) + check(r2, r1, R1) +
        check(R2, r1, R1);
  cout << ans;
  return 0;
}
