#include <bits/stdc++.h>
using namespace std;
int dcmp(double a, double b) {
  return fabs(a - b) <= 0.0000000001 ? 0 : (a > b) ? 1 : -1;
}
int main() {
  int x1, y1, x2, y2, r1, r2, R1, R2;
  cin >> x1 >> y1 >> r1 >> R1 >> x2 >> y2 >> r2 >> R2;
  double dis = sqrt((y2 - y1) * (y2 - y1) + (x2 - x1) * (x2 - x1));
  int ans = 0;
  if (dcmp(abs(dis - r1), R2) != -1 || dcmp(dis + r1, r2) != 1) ans++;
  if (dcmp(abs(dis - R1), R2) != -1 || dcmp(dis + R1, r2) != 1) ans++;
  if (dcmp(abs(dis - r2), R1) != -1 || dcmp(dis + r2, r1) != 1) ans++;
  if (dcmp(dis + R2, r1) != 1 || dcmp(abs(dis - R2), R1) != -1) ans++;
  cout << ans << endl;
}
