#include <bits/stdc++.h>
using namespace std;
bool intersect(double r1, double r2, double dist) {
  if (dist + 1e-9 >= r1 + r2 || dist + r1 - 1e-9 < r2 || dist + r2 - 1e-9 < r1)
    return false;
  return true;
}
int main() {
  double a, b, x, y, r1, r2, p1, p2;
  cin >> a >> b >> r1 >> r2 >> x >> y >> p1 >> p2;
  double dist = sqrt((a - x) * (a - x) + (b - y) * (b - y));
  int ans(0);
  for (auto i : {r1, r2}) {
    bool ok = 1;
    for (auto j : {p1, p2})
      if (intersect(i, j, dist)) ok = 0;
    ans += ok;
    if ((-dist + i >= p1 && dist + i <= p2) || i + p1 <= dist && p2 - dist >= i)
      ans--;
  }
  for (auto i : {p1, p2}) {
    bool ok = 1;
    for (auto j : {r1, r2})
      if (intersect(i, j, dist)) ok = 0;
    ans += ok;
    if ((-dist + i >= r1 && dist + i <= r2) || i + r1 <= dist && r2 - dist >= i)
      ans--;
  }
  cout << ans;
  return 0;
}
