#include <bits/stdc++.h>
using namespace std;
int x[3];
int y[3];
bool isok(int a, int b, int c) {
  if (b > c && a > c && a < b) return true;
  if (b < c && a > b && a < c) return true;
  return false;
}
bool TP() {
  if (x[1] == x[0] && isok(y[2], y[1], y[0])) return true;
  if (x[2] == x[0] && isok(y[1], y[2], y[0])) return true;
  if (x[2] == x[1] && isok(y[0], y[1], y[2])) return true;
  if (y[1] == y[0] && isok(x[2], x[1], x[0])) return true;
  if (y[2] == y[0] && isok(x[1], x[2], x[0])) return true;
  if (y[2] == y[1] && isok(x[0], x[1], x[2])) return true;
  return false;
}
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" << endl;
  else if (y[0] == y[1] && y[1] == y[2])
    cout << "1" << endl;
  else if ((x[0] != x[1] && x[1] != x[2] && x[2] != x[0]) &&
           (y[0] != y[1] && y[1] != y[2] && y[2] != y[0])) {
    cout << "3" << endl;
  } else {
    if (TP())
      cout << "3" << endl;
    else
      cout << "2" << endl;
  }
  return 0;
}
