#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]) {
    cout << 1;
    return 0;
  }
  if (y[0] == y[1] && y[1] == y[2]) {
    cout << 1;
    return 0;
  }
  if (x[0] == x[1]) {
    if (y[2] >= max(y[0], y[1]) || y[2] <= min(y[0], y[1])) {
      cout << 2;
      return 0;
    }
  }
  if (x[0] == x[2]) {
    if (y[1] >= max(y[0], y[2]) || y[1] <= min(y[0], y[2])) {
      cout << 2;
      return 0;
    }
  }
  if (x[1] == x[2]) {
    if (y[0] >= max(y[2], y[1]) || y[0] <= min(y[2], y[1])) {
      cout << 2;
      return 0;
    }
  }
  if (y[0] == y[1]) {
    if (x[2] >= max(x[0], x[1]) || x[2] <= min(x[0], x[1])) {
      cout << 2;
      return 0;
    }
  }
  if (y[0] == y[2]) {
    if (x[1] >= max(x[0], x[2]) || x[1] <= min(x[0], x[2])) {
      cout << 2;
      return 0;
    }
  }
  if (y[1] == y[2]) {
    if (x[0] >= max(x[2], x[1]) || x[0] <= min(x[2], x[1])) {
      cout << 2;
      return 0;
    }
  }
  cout << 3 << endl;
  return 0;
}
