#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:100000000")
using namespace std;
long long x[3], y[3];
int main() {
  for (int i = 0; i < 3; i++) cin >> x[i] >> y[i];
  if (x[0] == x[1] && x[0] == x[2] || y[0] == y[1] && y[0] == y[2]) {
    printf("1\n");
    return 0;
  }
  int perm[3] = {0, 1, 2};
  long long minx = min(x[0], min(x[1], x[2]));
  long long maxx = max(x[0], max(x[1], x[2]));
  long long miny = min(y[0], min(y[1], y[2]));
  long long maxy = max(y[0], max(y[1], y[2]));
  do {
    long long x1 = x[perm[0]], y1 = y[perm[0]];
    long long x2 = x[perm[1]], y2 = y[perm[1]];
    long long x3 = x[perm[2]], y3 = y[perm[2]];
    bool gr1 = false;
    bool gr2 = false;
    bool gr3 = false;
    if ((x1 == minx || x1 == maxx) && (y1 == miny || y1 == maxy)) gr1 = true;
    if ((x2 == minx || x2 == maxx) && (y2 == miny || y2 == maxy)) gr2 = true;
    if ((x3 == minx || x3 == maxx) && (y3 == miny || y3 == maxy)) gr3 = true;
    if (gr1 && gr2 && gr3) {
      printf("2");
      return 0;
    }
    if ((x1 == x2 || y1 == y2) && gr1 && gr3 && !gr2) {
      printf("2");
      return 0;
    }
  } while (next_permutation(perm, perm + 3));
  printf("3");
  return 0;
}
