#include <bits/stdc++.h>
using namespace std;
long long x[4], y[4], i;
bool ok(int a, int b, int c) {
  if (min(a, b) <= c && c <= max(a, b)) return true;
  return false;
}
bool ttt(int a, int b, int c) {
  if ((x[a] == x[c] || x[b] == x[c]) && ok(y[a], y[b], y[c])) return true;
  if ((y[a] == y[c] || y[b] == y[c]) && ok(x[a], x[b], x[c])) return true;
  return false;
}
int main() {
  for (i = 1; i <= 3; i++) cin >> x[i] >> y[i];
  if (x[1] == x[2] && x[2] == x[3]) {
    cout << 1;
    return 0;
  }
  if (y[1] == y[2] && y[2] == y[3]) {
    cout << 1;
    return 0;
  }
  if (ttt(1, 2, 3) || ttt(1, 3, 2) || ttt(2, 3, 1)) {
    cout << 2;
    return 0;
  }
  cout << 3;
}
