#include <bits/stdc++.h>
using namespace std;
long long manhattan(long long x, long long y, long long x2, long long y2) {
  return (abs(x - x2) ? 1 : 0) + (abs(y - y2) ? 1 : 0);
}
int main() {
  ios_base::sync_with_stdio(false);
  long long X[3], Y[3];
  for (int i = 0; i < (int)3; ++i) {
    cin >> X[i] >> Y[i];
  }
  if (X[0] == X[1] && X[1] == X[2] || Y[0] == Y[1] && Y[1] == Y[2]) {
    cout << 1 << endl;
    return 0;
  }
  int ans = 3;
  if (X[0] == X[1] && (Y[2] >= max(Y[0], Y[1]) || Y[2] <= min(Y[0], Y[1])))
    ans = 2;
  if (X[1] == X[2] && (Y[0] >= max(Y[2], Y[1]) || Y[0] <= min(Y[2], Y[1])))
    ans = 2;
  if (X[0] == X[2] && (Y[1] >= max(Y[2], Y[0]) || Y[1] <= min(Y[2], Y[0])))
    ans = 2;
  if (Y[0] == Y[1] && (X[2] >= max(X[0], X[1]) || X[2] <= min(X[0], X[1])))
    ans = 2;
  if (Y[1] == Y[2] && (X[0] >= max(X[2], X[1]) || X[0] <= min(X[2], X[1])))
    ans = 2;
  if (Y[0] == Y[2] && (X[1] >= max(X[2], X[0]) || X[1] <= min(X[2], X[0])))
    ans = 2;
  cout << ans << endl;
}
