#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T min(T a, T b, T c) {
  return min(min(a, b), c);
}
template <class T>
inline T max(T a, T b, T c) {
  return max(max(a, b), c);
}
template <class T>
inline T min(T a, T b, T c, T d) {
  return min(min(a, b), min(c, d));
}
template <class T>
inline T max(T a, T b, T c, T d) {
  return max(min(a, b), max(c, d));
}
template <class T>
inline T Sqr(T a) {
  return a * a;
}
template <class T>
inline T Cub(T a) {
  return a * a * a;
}
inline void MUL(int &a, int b, int MOD) { a = (long long)a * b % MOD; }
template <class T>
inline T Abs(T a) {
  return a > 0 ? a : -a;
}
inline int PPow(int a, int b, int MOD) {
  int c = 1;
  while (b) {
    if (b & 1) MUL(c, a, MOD);
    MUL(a, a, MOD), b >>= 1;
  }
  return c;
}
struct circle {
  double x, y;
  double r, R;
};
double d;
int check(circle a, circle b) {
  int ans = 0;
  if (a.r + d <= b.r || a.r + b.R <= d || b.R + d <= a.r) ans++;
  if (a.R + d <= b.r || a.R + b.R <= d || b.R + d <= a.R) ans++;
  return ans;
}
int main() {
  circle a, b;
  cin >> a.x >> a.y >> a.r >> a.R;
  cin >> b.x >> b.y >> b.r >> b.R;
  d = sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y));
  cout << check(a, b) + check(b, a) << endl;
  return 0;
}
