#include <bits/stdc++.h>
using namespace std;
int64_t get(int64_t x1, int64_t y1, int64_t x2, int64_t y2) {
  return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
}
void solve() {
  int n = 3;
  vector<int> x(n), y(n);
  for (int i = 0; i < n; ++i) {
    cin >> x[i] >> y[i];
  }
  map<int, int> zx, zy;
  for (int i = 0; i < n; ++i) {
    ++zx[x[i]];
    ++zy[y[i]];
  }
  if (zx.size() == 1 || zy.size() == 1) {
    cout << 1 << endl;
    return;
  }
  if (zx.size() == 2 && zy.size() == 2) {
    cout << 2 << endl;
    return;
  }
  if (zx.size() == 2 || zy.size() == 2) {
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < n; ++j) {
        if (i == j) continue;
        if (x[i] != x[j] && y[i] != y[j]) {
          for (int u = 0; u < n; ++u) {
            if (u != i && u != j) {
              if (x[i] == x[u] && (y[u] >= y[i] && y[u] <= y[j] ||
                                   y[u] <= y[i] && y[u] >= y[j])) {
                cout << 2 << endl;
                return;
              }
              if (y[i] == y[u] && (x[u] >= x[i] && x[u] <= x[j] ||
                                   x[u] <= x[i] && x[u] >= x[j])) {
                cout << 2 << endl;
                return;
              }
            }
          }
        }
      }
    }
  }
  cout << 3 << endl;
}
int main() {
  std::ios_base::sync_with_stdio(false);
  solve();
  return 0;
}
