#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  vector<pair<int, int> > v(3);
  for (int i = 0; i < 3; i += 1) cin >> v[i].first >> v[i].second;
  sort(v.begin(), v.end());
  int fl = 0;
  if (v[1].first == v[0].first)
    fl = 1;
  else if (v[1].second == v[0].second)
    fl = 2;
  else
    fl = 3;
  int fl2 = 0;
  if (v[2].first == v[1].first)
    fl2 = 1;
  else if (v[2].second == v[1].second)
    fl2 = 2;
  else
    fl2 = 3;
  if ((fl == 1 && fl2 == 1) || (fl == 2 && fl2 == 2))
    cout << 1;
  else if (fl == 2 || fl2 == 2)
    cout << 2;
  else if (fl == 1 && (v[2].second >= max(v[1].second, v[0].second) ||
                       v[2].second <= min(v[1].second, v[0].second)))
    cout << 2;
  else if (fl2 == 1 && (v[0].second <= min(v[1].second, v[2].second) ||
                        v[0].second >= max(v[1].second, v[2].second)))
    cout << 2;
  else
    cout << 3;
}
