#include <bits/stdc++.h>
using namespace std;
const int X = 100000 + 5;
bool ok1(long long x1, long long y1, long long x2, long long y2, long long x3,
         long long y3) {
  if (x1 == x2 && x2 == x3) return 1;
  if (y1 == y2 && y2 == y3) return 1;
  return 0;
}
bool ok2(long long x1, long long y1, long long x2, long long y2, long long x3,
         long long y3) {
  if (y1 == y2) {
    if (x3 <= min(x1, x2)) return 1;
    if (x3 >= max(x1, x2)) return 1;
  } else if (y1 == y3) {
    if (x2 <= min(x1, x3)) return 1;
    if (x2 >= max(x1, x3)) return 1;
  } else if (y2 == y3) {
    if (x1 <= min(x3, x2)) return 1;
    if (x1 >= max(x3, x2)) return 1;
  }
  return 0;
}
bool ok22(long long x1, long long y1, long long x2, long long y2, long long x3,
          long long y3) {
  if (x1 == x2) {
    if (y3 <= min(y1, y2)) return 1;
    if (y3 >= max(y1, y2)) return 1;
  } else if (x1 == x3) {
    if (y2 <= min(y1, y3)) return 1;
    if (y2 >= max(y1, y3)) return 1;
  }
  if (x3 == x2) {
    if (y1 <= min(y3, y2)) return 1;
    if (y1 >= max(y3, y2)) return 1;
  }
  return 0;
}
void MAIN() {
  long long x1, y1, x2, y2, x3, y3;
  cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
  if (ok1(x1, y1, x2, y2, x3, y3)) {
    cout << 1;
  } else if (ok2(x1, y1, x2, y2, x3, y3) || ok22(x1, y1, x2, y2, x3, y3)) {
    cout << 2;
  } else {
    cout << 3;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout << setprecision(12);
  MAIN();
  return 0;
}
