#include <bits/stdc++.h>
using namespace std;
int x[3], y[3];
int main() {
  for (int i = 0; i < 3; i++) cin >> x[i] >> y[i];
  if ((x[0] == x[1] && x[1] == x[2]) || (y[0] == y[1] && y[1] == y[2])) {
    cout << 1 << endl;
    return 0;
  }
  for (int i = 0; i < 3; i++)
    for (int j = i + 1; j < 3; j++)
      if ((x[i] == x[j] && (y[3 - i - j] <= min(y[i], y[j]) ||
                            (y[3 - i - j] >= max(y[i], y[j])))) ||
          (y[i] == y[j] && (x[3 - i - j] <= min(x[i], x[j]) ||
                            (x[3 - i - j] >= max(x[i], x[j]))))) {
        cout << 2 << endl;
        return 0;
      }
  cout << 3 << endl;
  return 0;
}
