#include <bits/stdc++.h>
using namespace std;
double x[2], y[2], r[2], R[2];
void solve() {
  double dx = x[0] - x[1];
  double dy = y[0] - y[1];
  double d = sqrt(dx * dx + dy * dy);
  int ans = 0;
  if (r[0] + R[1] <= d || d + r[0] <= r[1] || d + R[1] <= r[0]) ans++;
  if (R[0] + R[1] <= d || d + R[0] <= r[1] || d + R[1] <= R[0]) ans++;
  if (r[1] + R[0] <= d || d + r[1] <= r[0] || d + R[0] <= r[1]) ans++;
  if (R[0] + R[1] <= d || d + R[1] <= r[0] || d + R[0] <= R[1]) ans++;
  cout << ans;
}
int main() {
  for (int i = 0; i < 2; i++) cin >> x[i] >> y[i] >> r[i] >> R[i];
  solve();
  return 0;
}
