#include <bits/stdc++.h>
using namespace std;
int main() {
  int x, y;
  vector<pair<int, int> > v, ve;
  set<int> setx, sety;
  for (int i = 0; i < 3; i++) {
    cin >> x >> y;
    v.push_back(make_pair(x, y));
    setx.insert(x);
    sety.insert(y);
  }
  if (setx.size() == 1 || sety.size() == 1) {
    cout << "1" << endl;
  } else if (setx.size() == 2) {
    if (sety.size() == 2) {
      cout << "2" << endl;
    } else {
      for (int j = 0; j < 3; j++) {
        ve.push_back(make_pair(v[j].second, v[j].first));
      }
      sort(ve.begin(), ve.end());
      if (ve[0].second == ve[1].second || ve[1].second == ve[2].second) {
        cout << "2" << endl;
      } else {
        cout << "3" << endl;
      }
    }
  } else if (sety.size() == 2) {
    if (setx.size() == 2) {
      cout << "2" << endl;
    } else {
      for (int j = 0; j < 3; j++) {
        ve.push_back(make_pair(v[j].first, v[j].second));
      }
      sort(ve.begin(), ve.end());
      if (ve[0].second == ve[1].second || ve[1].second == ve[2].second) {
        cout << "2" << endl;
      } else {
        cout << "3" << endl;
      }
    }
  } else {
    cout << "3" << endl;
  }
}
