#include <bits/stdc++.h>
using namespace std;
void read() {}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  read();
  pair<int, int> a, b, c;
  cin >> a.first >> a.second >> b.first >> b.second >> c.first >> c.second;
  if (a.first == b.first && b.first == c.first ||
      a.second == b.second && b.second == c.second)
    cout << "1\n";
  else if (a.first == b.first && (c.second <= min(a.second, b.second) ||
                                  c.second >= max(a.second, b.second)) ||
           a.first == c.first && (b.second <= min(a.second, c.second) ||
                                  b.second >= max(a.second, c.second)) ||
           c.first == b.first && (a.second <= min(c.second, b.second) ||
                                  a.second >= max(c.second, b.second)) ||
           a.second == b.second && (c.first <= min(a.first, b.first) ||
                                    c.first >= max(a.first, b.first)) ||
           a.second == c.second && (b.first <= min(a.first, c.first) ||
                                    b.first >= max(a.first, c.first)) ||
           c.second == b.second && (a.first <= min(c.first, b.first) ||
                                    a.first >= max(c.first, b.first)))
    cout << "2\n";
  else
    cout << "3\n";
}
