#include <iostream>

using namespace std;

template<class T>
struct Vec2
{
	Vec2(){}
	Vec2(T _x, T _y) : x(_x), y(_y) {}

	Vec2 operator+(const Vec2& rhs) const { return Vec2(x + rhs.x, y + rhs.y); }
	Vec2 operator-(const Vec2& rhs) const { return Vec2(x - rhs.x, y - rhs.y); }
	T sqlength() const { return x*x + y*y; }

	T x;
	T y;
};

int main()
{
	typedef Vec2<long long> Vec;
	long long x1, y1, r1, x2, y2, r2;
	cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;
	long long dsq = (Vec(x1, y1) - Vec(x2, y2)).sqlength();
	if (dsq > (r1 + r2)*(r1 + r2)) cout << 4 << endl;
	else if (dsq == (r1 + r2)*(r1 + r2)) cout << 3 << endl;
	else if (dsq > (r1 - r2)*(r1 - r2)) cout << 2 << endl;
	else if (dsq == (r1 - r2)*(r1 - r2)) cout << 1 << endl;
	else cout << 0 << endl;
	return 0;
}
