#include <bits/stdc++.h>
using namespace std;
using ll = long long;
struct node {
  double x, y, r1, r2;
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  vector<node> v(2);
  int ans = 0;
  for (int i = 0; i < 2; i++) cin >> v[i].x >> v[i].y >> v[i].r1 >> v[i].r2;
  double d = sqrt((v[0].x - v[1].x) * (v[0].x - v[1].x) +
                  (v[0].y - v[1].y) * (v[0].y - v[1].y));
  if (d >= v[0].r1 + v[1].r2 - 0.005 || v[0].r1 + d - 0.005 <= v[1].r1 ||
      v[1].r2 + d - 0.005 <= v[0].r1)
    ans++;
  if (d >= v[0].r2 + v[1].r2 - 0.005 || v[0].r2 + d - 0.005 <= v[1].r1 ||
      v[1].r2 + d - 0.005 <= v[0].r2)
    ans++;
  if (d >= v[1].r1 + v[0].r2 - 0.005 || v[1].r1 + d - 0.005 <= v[0].r1 ||
      v[0].r2 + d - 0.005 <= v[1].r1)
    ans++;
  if (d >= v[1].r2 + v[0].r2 - 0.005 || v[1].r2 + d - 0.005 <= v[0].r1 ||
      v[0].r2 + d - 0.005 <= v[1].r2)
    ans++;
  cout << ans;
}
