#include <bits/stdc++.h>
using namespace std;
double dist;
int check(double ri1, double ro1, double ri2, double ro2) {
  int ans = 0;
  if (dist + ro1 <= ri2 || dist >= ro1 + ro2 || dist + ro2 <= ro1) ans++;
  if (dist + ri1 <= ri2 || dist >= ri1 + ro2 || dist + ro2 <= ri1) ans++;
  return ans;
}
int main(void) {
  double x1, x2, y1, y2, ri1, ro1, ri2, ro2;
  cin >> x1 >> y1 >> ri1 >> ro1;
  cin >> x2 >> y2 >> ri2 >> ro2;
  dist = sqrt(pow((x2 - x1), 2) + pow((y2 - y1), 2));
  cout << check(ri1, ro1, ri2, ro2) + check(ri2, ro2, ri1, ro1) << endl;
  return 0;
}
