#include <bits/stdc++.h>
int min(int a, int b) { return a < b ? a : b; }
int max(int a, int b) { return a > b ? a : b; }
int solve() {
  int x1, y1, x2, y2, x3, y3;
  scanf("%d%d%d%d%d%d", &x1, &y1, &x2, &y2, &x3, &y3);
  if (x1 == x2 && x2 == x3 || y1 == y2 && y2 == y3) return 1;
  if (x1 == x2 && (y3 <= min(y1, y2) || y3 >= max(y1, y2))) return 2;
  if (x2 == x3 && (y1 <= min(y2, y3) || y1 >= max(y2, y3))) return 2;
  if (x3 == x1 && (y2 <= min(y3, y1) || y2 >= max(y3, y1))) return 2;
  if (y1 == y2 && (x3 <= min(x1, x2) || x3 >= max(x1, x2))) return 2;
  if (y2 == y3 && (x1 <= min(x2, x3) || x1 >= max(x2, x3))) return 2;
  if (y3 == y1 && (x2 <= min(x3, x1) || x2 >= max(x3, x1))) return 2;
  return 3;
}
int main() {
  printf("%d\n", solve());
  return 0;
}
