#include <bits/stdc++.h>
using namespace std;
int const N = 101;
long long const INF = 1 << 30;
double eps = 1.0e-8;
const double pai = acos(-1.0);
const double g = 9.87;
double x1, yy1, r1, R1;
double x2, y2, r2, R2;
double f(double x) { return x * x; }
int main() {
  cin >> x1 >> yy1 >> r1 >> R1 >> x2 >> y2 >> r2 >> R2;
  double d = sqrt(f(x1 - x2) + f(yy1 - y2));
  int ans = 0;
  if (d + eps >= r1 + R2 || d <= r2 - r1 + eps || d <= r1 - R2 + eps) ans++;
  if (d + eps >= R1 + R2 || d <= r2 - R1 + eps || d <= R1 - R2 + eps) ans++;
  if (d + eps >= r2 + R1 || d <= r1 - r2 + eps || d <= r2 - R1 + eps) ans++;
  if (d + eps >= R2 + R1 || d <= r1 - R2 + eps || d <= R2 - R1 + eps) ans++;
  cout << ans << endl;
  return 0;
}
