#include <bits/stdc++.h>
using namespace std;
struct P {
  int x, y;
} p1, p2, p3;
int solve() {
  if (p1.x == p2.x && p1.x == p3.x) return 1;
  if (p1.y == p2.y && p1.y == p3.y) return 1;
  if (p1.x == p2.x) {
    if (p3.y <= min(p1.y, p2.y)) return 2;
    if (p3.y >= max(p1.y, p2.y)) return 2;
    return 3;
  }
  if (p1.x == p3.x) {
    if (p2.y <= min(p1.y, p3.y)) return 2;
    if (p2.y >= max(p1.y, p3.y)) return 2;
    return 3;
  }
  if (p2.x == p3.x) {
    if (p1.y <= min(p2.y, p3.y)) return 2;
    if (p1.y >= max(p2.y, p3.y)) return 2;
    return 3;
  }
  if (p1.y == p2.y) {
    if (p3.x <= min(p1.x, p2.x)) return 2;
    if (p3.x >= max(p1.x, p2.x)) return 2;
    return 3;
  }
  if (p1.y == p3.y) {
    if (p2.x <= min(p1.x, p3.x)) return 2;
    if (p2.x >= max(p1.x, p3.x)) return 2;
    return 3;
  }
  if (p2.y == p3.y) {
    if (p1.x <= min(p2.x, p3.x)) return 2;
    if (p1.x >= max(p2.x, p3.x)) return 2;
    return 3;
  }
  return 3;
}
int main() {
  scanf("%d%d", &p1.x, &p1.y);
  scanf("%d%d", &p2.x, &p2.y);
  scanf("%d%d", &p3.x, &p3.y);
  printf("%d", solve());
  return 0;
}
