#include <bits/stdc++.h>
using namespace std;
void read_file(bool outToFile = true) {}
int main() {
  read_file();
  int n = 3;
  pair<int, int> A[3];
  while (cin >> A[0].first) {
    cin >> A[0].second;
    for (int i = 1; i < n; i++) cin >> A[i].first >> A[i].second;
    if (A[0].first == A[1].first && A[1].first == A[2].first) {
      cout << 1 << '\n';
      continue;
    }
    if (A[0].second == A[1].second && A[1].second == A[2].second) {
      cout << 1 << '\n';
      continue;
    }
    int ans = -1;
    for (int i = 0; i < n; i++) {
      for (int j = i + 1; j < n; j++) {
        if (A[i].first == A[j].first) {
          int k = -1;
          for (int kk = 0; kk < n; kk++)
            if (kk != i && kk != j) k = kk;
          if (min(A[i].second, A[j].second) < A[k].second &&
              A[k].second < max(A[i].second, A[j].second))
            ;
          else
            ans = 2;
        }
        if (A[i].second == A[j].second) {
          int k = -1;
          for (int kk = 0; kk < n; kk++)
            if (kk != i && kk != j) k = kk;
          if (min(A[i].first, A[j].first) < A[k].first &&
              A[k].first < max(A[i].first, A[j].first))
            ;
          else
            ans = 2;
        }
      }
    }
    if (ans == -1) ans = 3;
    cout << ans << '\n';
  }
}
