#include <bits/stdc++.h>
using namespace std;
int main() {
  double x1, y1, x2, y2, r1, r2, R1, R2;
  cin >> x1 >> y1 >> r1 >> R1 >> x2 >> y2 >> r2 >> R2;
  double di = sqrt((double)((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)));
  int ans = 0;
  if (di + r1 <= r2 || abs(di - r1) >= R2) ans++;
  if (di + R1 <= r2 || abs(di - R1) >= R2) ans++;
  if (di + r2 <= r1 || abs(di - r2) >= R1) ans++;
  if (di + R2 <= r1 || abs(di - R2) >= R1) ans++;
  cout << ans << endl;
}
