#include <bits/stdc++.h>
using namespace std;
bool sameLine(pair<int, int> a, pair<int, int> b) { return a.first == b.first; }
bool sameCol(pair<int, int> a, pair<int, int> b) {
  return a.second == b.second;
}
int main() {
  cin.sync_with_stdio(false);
  int xa, ya, xb, yb, xc, yc;
  cin >> xa >> ya >> xb >> yb >> xc >> yc;
  pair<int, int> p[4];
  p[1] = make_pair(xa, ya);
  p[2] = make_pair(xb, yb);
  p[3] = make_pair(xc, yc);
  if (sameLine(p[1], p[2]) && sameLine(p[1], p[3])) {
    cout << 1;
    return 0;
  } else if (sameCol(p[1], p[2]) && sameCol(p[1], p[3])) {
    cout << 1;
    return 0;
  }
  for (int i = 1; i <= 3; i++)
    for (int j = i + 1; j <= 3; j++) {
      int k = i ^ j;
      if (sameLine(p[i], p[j]) &&
          (p[k].second <= min(p[i].second, p[j].second) ||
           p[k].second >= max(p[i].second, p[j].second))) {
        cout << 2;
        return 0;
      }
      if (sameCol(p[i], p[j]) && (p[k].first <= min(p[i].first, p[j].first) ||
                                  p[k].first >= max(p[i].first, p[j].first))) {
        cout << 2;
        return 0;
      }
    }
  cout << 3;
  return 0;
}
