#include <bits/stdc++.h>
using namespace std;
pair<int, int> p[3];
int check2(int i, int j, int k) {
  if (p[i].second == p[j].second &&
      ((((p[k].first - p[i].first) < 0) == ((p[k].first - p[j].first) < 0)) ||
       (p[k].first == p[i].first) || (p[k].first == p[j].first))) {
    return 2;
  }
  return 3;
}
int min(int a, int b, int c) { return min(min(a, b), c); }
int main() {
  int n = 3;
  cin >> p[0].first >> p[0].second >> p[1].first >> p[1].second >> p[2].first >>
      p[2].second;
  if (((p[0].first == p[1].first) && (p[1].first == p[2].first)) ||
      ((p[0].second == p[1].second) && (p[1].second == p[2].second))) {
    cout << "1\n";
    return 0;
  }
  int best = 3;
  best = min(check2(0, 1, 2), check2(0, 2, 1), check2(2, 1, 0));
  for (int i = 0; i < 3; ++i) swap(p[i].first, p[i].second);
  best = min(best, check2(0, 2, 1), check2(2, 1, 0));
  best = min(best, check2(0, 1, 2));
  for (int i = 0; i < 3; ++i) swap(p[i].first, p[i].second);
  cout << best << "\n";
}
