#include <bits/stdc++.h>
int main() {
  int x[3], y[3];
  int cont = 0;
  int min1, min2, min3;
  for (int i = 0; i < 3; i++) scanf("%d %d", &x[i], &y[i]);
  if ((x[0] == x[1] && x[1] == x[2]) || (y[0] == y[1] && y[1] == y[2])) {
    cont = 1;
  } else if (x[0] == x[1] || y[0] == y[1]) {
    if (x[2] == x[1] || y[2] == y[1])
      cont = 2;
    else if (x[2] == x[0] || y[2] == y[0])
      cont = 2;
    else if (x[0] == x[1] && (y[2] >= (((y[1]) > (y[0])) ? (y[1]) : (y[0])) ||
                              y[2] <= (((y[1]) > (y[0])) ? (y[0]) : (y[1]))))
      cont = 2;
    else if (y[0] == y[1] && (x[2] >= (((x[1]) > (x[0])) ? (x[1]) : (x[0])) ||
                              x[2] <= (((x[1]) > (x[0])) ? (x[0]) : (x[1]))))
      cont = 2;
    else
      cont = 3;
  } else if (x[0] == x[2] || y[0] == y[2]) {
    if (x[2] == x[1] || y[2] == y[1])
      cont = 2;
    else if (x[1] == x[0] || y[1] == y[0])
      cont = 2;
    else if (x[0] == x[2] && (y[1] >= (((y[2]) > (y[0])) ? (y[2]) : (y[0])) ||
                              y[1] <= (((y[2]) > (y[0])) ? (y[0]) : (y[2]))))
      cont = 2;
    else if (y[0] == y[2] && (x[1] >= (((x[2]) > (x[0])) ? (x[2]) : (x[0])) ||
                              x[1] <= (((x[2]) > (x[0])) ? (x[0]) : (x[2]))))
      cont = 2;
    else
      cont = 3;
  } else {
    if (x[2] == x[1] && (y[0] >= (((y[1]) > (y[2])) ? (y[1]) : (y[2])) ||
                         y[0] <= (((y[1]) > (y[2])) ? (y[2]) : (y[1]))))
      cont = 2;
    else if (y[2] == y[1] && (x[0] >= (((x[1]) > (x[2])) ? (x[1]) : (x[2])) ||
                              x[0] <= (((x[1]) > (x[2])) ? (x[2]) : (x[1]))))
      cont = 2;
    else
      cont = 3;
  }
  printf("%d\n", cont);
  return 0;
}
