#include <bits/stdc++.h>
using namespace std;
const int N = 2e3 + 50;
const int M = 1e3 + 50;
const int INF = 0x3f3f3f3f;
const double pi = 3.1415962;
using namespace std;
using namespace std;
struct point {
  int x, y;
} p[N];
bool cmp(point a, point b) {
  if (a.x == b.x) return a.y < b.y;
  return a.x < b.x;
}
int main() {
  for (int i = 0; i < 3; i++) {
    scanf("%d%d", &p[i].x, &p[i].y);
  }
  int ans = 3;
  sort(p, p + 3, cmp);
  if ((p[0].x == p[1].x && p[0].x == p[2].x) ||
      (p[0].y == p[1].y && p[0].y == p[2].y))
    ans = 1;
  else if ((p[1].x == p[2].x && p[0].y > p[1].y && p[0].y < p[2].y) ||
           (p[1].x == p[0].x && p[2].y > p[0].y && p[2].y < p[1].y))
    ans = 3;
  else if (p[1].x == p[2].x || p[1].y == p[0].y || p[1].x == p[0].x ||
           p[1].y == p[2].y)
    ans = 2;
  printf("%d\n", ans);
  return 0;
}
