#include <bits/stdc++.h>
using namespace std;

const int MAXN = 50000 + 10;
const double pi = acos(-1.0);
const double inf = 1e100;
const double eps = 1e-12;

typedef struct point vec; //向量vec
struct point { //点的基本数据结构
    double x, y;
    point(double _x = 0, double _y = 0)
        : x(_x)
        , y(_y)
    {
    }
    point operator*(const point& i_T) const
    {
        return point(x * i_T.x, y * i_T.y);
    }
    point operator*(double u) const
    {
        return point(x * u, y * u);
    }
    bool operator==(const point& i_T) const
    {
        return x == i_T.x && y == i_T.y;
    }
    point operator/(double u) const
    {
        return point(x / u, y / u);
    }
    point operator+(const point& i_T)
    {
        return point(x + i_T.x, y + i_T.y);
    }
    point operator-(const point& i_T)
    {
        return point(x - i_T.x, y - i_T.y);
    }
    friend bool operator<(point a, point b)
    {
        return fabs(a.x - b.x) < eps ? a.y < b.y : a.x < b.x;
    }
    friend ostream& operator<<(ostream& out, point& a)
    {
        //cout << a.x << ' ' << a.y;
        printf("%.8f %.8f", a.x + eps, a.y + eps);
        return out;
    }
    friend istream& operator>>(istream& in, point& a)
    {
        in >> a.x >> a.y;
        return in;
    }
};
struct cirles {
    point o;
    double r;
    cirles(point _o = point(), double _r = 0.0)
        : r(_r)
        , o(_o)
    {
    }
    point Point(double t) //圆上任意一点
    {
        return point(o.x + r * cos(t), o.y + r * sin(t));
    }
    friend istream& operator>>(istream& in, cirles& a)
    {
        in >> a.o >> a.r;
        return in;
    }
    friend ostream& operator<<(ostream& out, cirles& a)
    {
        out << a.o << ' ' << a.r;
        return out;
    }
};
double changdu(vec a) //向量长度
{
    return sqrt(a.x * a.x + a.y * a.y);
}
vec xiangliang_xuanzhuan(vec a, double pi) //将向量按照起点旋转逆时针pi,
{
    double x, y;
    x = cos(pi) * a.x - sin(pi) * a.y;
    y = sin(pi) * a.x + cos(pi) * a.y;
    return vec(x, y);
}
int dayu_dengyu(double x, double y)
{
    if (fabs(x - y) < eps || x > y)
        return 1;
    return 0;
}
int bijiao(double x, double y)
{
    if (fabs(x - y) < eps)
        return 0;
    if (x > y)
        return 1;
    return -1;
}
int zhengfu(double d) //判断正负
{
    if (fabs(d) < eps)
        return 0;
    if (d > 0)
        return 1;
    return -1;
}
point u[10], v[10];
int yuanyuan_gongqiexian(cirles a, cirles b)
{
    int cnt = 0;
    if (a.r < b.r) {
        swap(a, b);
        swap(u, v);
    }
    double l = changdu(a.o - b.o);
    double rdiff = a.r - b.r;
    double rsum = a.r + b.r;
    if (zhengfu(l - rdiff) < 0)
        return 0;
    double base = atan2((b.o - a.o).y, (b.o - a.o).x);
    if (zhengfu(l) == 0)
        return -1;
    if (zhengfu(l - rdiff) == 0) {
        u[cnt] = v[cnt] = a.Point(base);
        cnt++;
        return 1;
    }
    double ang = acos((a.r - b.r) / l);
    u[cnt] = a.Point(base + ang);
    v[cnt] = b.Point(base + ang);
    cnt++;
    u[cnt] = a.Point(base - ang);
    v[cnt] = b.Point(base - ang);
    cnt++;
    if (zhengfu(l - rsum) == 0) {
        u[cnt] = v[cnt] = a.Point(base);
        cnt++;
    } else if (zhengfu(l - rsum) > 0) {
        double ang = acos((a.r + b.r) / l);
        u[cnt] = a.Point(base + ang);
        v[cnt] = b.Point(pi + base + ang);
        cnt++;
        u[cnt] = a.Point(base - ang);
        v[cnt] = b.Point(pi + base - ang);
        cnt++;
    }
    return cnt;
}
int main()
{
    //freopen("txt.txt", "w", stdout);
    cirles a, b;
    cin >> a >> b;
    int cnt = yuanyuan_gongqiexian(a, b);
    /*if (cnt == 0)
        return 0;
    sort(u, u + cnt);
    for (int i = 0; i < cnt; i++)
        cout << u[i] << endl;*/
    cout<<cnt<<endl;
    return 0;
}


Measured memory_bytes: 3628