#include<stdio.h>
int math_minus(int,int);
int math_plus(int,int);
void result(int,int,int);
int main(void){
  int i,c1[3],c2[3],x,y,z,t;
  for(i = 0; i < 3; i++){
    scanf("%d",&c1[i]);
  }
  for(i = 0; i < 3; i++){
    scanf("%d",&c2[i]);
  }
  x = math_minus(c1[0],c2[0]);
  y = math_minus(c1[1],c2[1]);
  z = math_plus(c1[2],c2[2]);
  t = math_minus(c1[2],c2[2]);

  if((x + y) > z )printf("4\n");
  if((x + y) == z)printf("3\n");
  if((x + y) < z){
    if((x + y) > t)printf("2\n");
    if((x + y) == t)printf("1\n");
    if((x + y) < t)printf("0\n");
  }

  return 0;
}
int math_minus(int x,int y){
  return (x - y) * (x - y);
}

int math_plus(int x,int y){
  return (x + y) * (x + y);
}

