#include <bits/stdc++.h>
using namespace std;
pair<int, int> P[5];
int main() {
  ios_base::sync_with_stdio(false);
  for (int i = 1; i <= 3; ++i) cin >> P[i].first >> P[i].second;
  sort(P + 1, P + 3 + 1);
  if (P[3].first == P[2].first || P[3].first == P[1].first) {
    if (P[1].first != P[3].first)
      swap(P[1], P[3]);
    else
      swap(P[2], P[3]);
  }
  if (P[1].first != P[2].first) {
    if (P[1].second != P[3].second)
      swap(P[1], P[3]);
    else
      swap(P[2], P[3]);
  }
  int sol = 0;
  int sameX = 0;
  int sameY = 0;
  if (P[1].first == P[2].first) {
    sol++;
    sameX = 1;
  }
  if (P[1].second == P[2].second) {
    sol++;
    sameY = 1;
  }
  assert(sameX + sameY != 2);
  if (sameX) {
    if (P[3].first == P[1].first)
      ;
    else {
      if (P[1].second == P[3].second || P[2].second == P[3].second)
        sol++;
      else {
        if (P[3].second < min(P[1].second, P[2].second) ||
            P[3].second > max(P[1].second, P[2].second))
          sol++;
        else
          sol += 2;
      }
    }
  } else if (sameY) {
    if (P[3].second == P[1].second)
      ;
    else {
      if (P[1].first == P[3].first || P[2].first == P[3].first)
        sol++;
      else {
        if (P[3].first < min(P[1].first, P[2].first) ||
            P[3].first > max(P[1].first, P[2].first))
          sol++;
        else
          sol += 2;
      }
    }
  } else {
    sol += 2;
    if (P[3].first == P[1].first || P[3].first == P[2].first ||
        P[3].second == P[1].second || P[3].second == P[2].second)
      ;
    else {
      sol += 1;
    }
  }
  cout << sol << "\n";
  return 0;
}
