#include <bits/stdc++.h>
using namespace std;
int in(int a, int b, int c) {
  if (b < c && a < b) return 1;
  if (a > b && b > c) return 1;
  return 0;
}
struct point {
  int x, y;
};
point pp[5];
int main() {
  for (int i = 0; i < 3; i++) scanf("%d%d", &pp[i].x, &pp[i].y);
  int ans = -1;
  if (pp[0].x == pp[1].x && pp[1].x == pp[2].x)
    ans = 1;
  else if (pp[0].y == pp[1].y && pp[1].y == pp[2].y)
    ans = 1;
  if (ans == -1) {
    for (int i = 0; i < 3; i++) {
      if (pp[i].x == pp[(i + 1) % 3].x && pp[i].y == pp[(i + 2) % 3].y) ans = 2;
      if (pp[i].y == pp[(i + 1) % 3].y && pp[i].x == pp[(i + 2) % 3].x) ans = 2;
    }
  }
  if (ans == -1) {
    for (int i = 0; i < 3; i++) {
      if (pp[i].x == pp[(i + 1) % 3].x) {
        if (!in(pp[i].y, pp[(i + 2) % 3].y, pp[(i + 1) % 3].y)) ans = 2;
      }
      if (pp[i].y == pp[(i + 1) % 3].y) {
        if (!in(pp[i].x, pp[(i + 2) % 3].x, pp[(i + 1) % 3].x)) ans = 2;
      }
    }
  }
  if (ans == -1) ans = 3;
  printf("%d\n", ans);
  return 0;
}
