#include <bits/stdc++.h>
using namespace std;
int main() {
  pair<int, int> tacke[3];
  for (int i = 0; i < 3; i++) {
    scanf("%d%d", &tacke[i].first, &tacke[i].second);
  }
  if ((tacke[0].first == tacke[1].first && tacke[0].first == tacke[2].first) ||
      (tacke[0].second == tacke[1].second &&
       tacke[0].second == tacke[2].second)) {
    cout << "1";
    return 0;
  }
  for (int i = 0; i < 3; i++) {
    if (tacke[0].first == tacke[1].first) {
      if ((tacke[0].second >= tacke[2].second &&
           tacke[1].second >= tacke[2].second) ||
          (tacke[0].second <= tacke[2].second &&
           tacke[1].second <= tacke[2].second)) {
        cout << "2";
        return 0;
      }
    }
    if (tacke[0].second == tacke[1].second) {
      if ((tacke[0].first >= tacke[2].first &&
           tacke[1].first >= tacke[2].first) ||
          (tacke[0].first <= tacke[2].first &&
           tacke[1].first <= tacke[2].first)) {
        cout << "2";
        return 0;
      }
    }
    if (i == 0) swap(tacke[1], tacke[2]);
    if (i == 1) swap(tacke[0], tacke[2]);
  }
  cout << "3";
  return 0;
}
