#include <bits/stdc++.h>
using namespace std;
bool in(long a, long b, long c) {
  if (a < b && a > c) return true;
  if (a < c && a > b) return true;
  return false;
}
int main(int argc, char* argv[]) {
  long x1, y1, x2, y2, x3, y3;
  cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
  if ((x1 == x2 && x2 == x3) || (y1 == y2 && y2 == y3)) {
    cout << 1;
  } else if ((x1 != x2 && x2 != x3 && x1 != x3) &&
             (y1 != y2 && y2 != y3 && y1 != y3)) {
    cout << 3;
  } else if ((x2 == x1 && in(y3, y1, y2)) || (y2 == y1 && in(x3, x1, x2))) {
    cout << 3;
  } else if ((x3 == x1 && in(y2, y1, y3)) || (y3 == y1 && in(x2, x1, x3))) {
    cout << 3;
  } else if ((x2 == x3 && in(y1, y3, y2)) || (y2 == y3 && in(x1, x3, x2))) {
    cout << 3;
  } else {
    cout << 2;
  }
  return 0;
}
