#include <bits/stdc++.h>
using namespace std;
int pl(int x, int y, int x1, int y1, int x2, int y2) {
  if (x == x1 && min(y1, y2) <= y && y <= max(y1, y2)) return 1;
  if (x == x2 && min(y1, y2) <= y && y <= max(y1, y2)) return 1;
  return 0;
}
int main() {
  int x1, x2, x3, y1, y2, y3, res;
  scanf(" %d %d %d %d %d %d", &x1, &y1, &x2, &y2, &x3, &y3);
  res = 3;
  for (int i = 0; i <= 1; i++) {
    if (x1 == x2 && x2 == x3)
      res = 1;
    else if (y1 == y2 && y2 == y3)
      res = 1;
    else if (pl(x1, y1, x2, y2, x3, y3))
      res = 2;
    else if (pl(x2, y2, x1, y1, x3, y3))
      res = 2;
    else if (pl(x3, y3, x1, y1, x2, y2))
      res = 2;
    swap(x1, y1);
    swap(x2, y2);
    swap(x3, y3);
  }
  printf("%d\n", res);
  return 0;
}
