#include <bits/stdc++.h>
using namespace std;
struct Node {
  int x, y;
};
Node node[3];
bool cmp(Node a, Node b) {
  if (a.x != b.x) return a.x < b.x;
  return a.y < b.y;
}
int main() {
  int x1, y1, x2, y2, x3, y3;
  while (~scanf("%d%d%d%d%d%d", &node[0].x, &node[0].y, &node[1].x, &node[1].y,
                &node[2].x, &node[2].y)) {
    int sum;
    x1 = node[0].x;
    y1 = node[0].y;
    x2 = node[1].x;
    y2 = node[1].y;
    x3 = node[2].x;
    y3 = node[2].y;
    if ((x1 == x2 && x2 == x3) || (y1 == y2 && y2 == y3))
      sum = 1;
    else if (x1 == x2 && (y3 >= max(y1, y2) || y3 <= min(y1, y2)))
      sum = 2;
    else if (x2 == x3 && (y1 >= max(y2, y3) || y1 <= min(y2, y3)))
      sum = 2;
    else if (x1 == x3 && (y2 >= max(y1, y3) || y2 <= min(y1, y3)))
      sum = 2;
    else if (y1 == y2 && (x3 >= max(x1, x2) || x3 <= min(x1, x2)))
      sum = 2;
    else if (y2 == y3 && (x1 >= max(x2, x3) || x1 <= min(x2, x3)))
      sum = 2;
    else if (y1 == y3 && (x2 >= max(x1, x3) || x2 <= min(x1, x3)))
      sum = 2;
    else
      sum = 3;
    printf("%d\n", sum);
  }
  return 0;
}
