#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int a, b, c, d, e, f;
  double p, w;
  cin >> a >> b >> c >> d >> e >> f;
  if ((b == d && b == f) || (a == c && a == e)) {
    cout << 1;
    return 0;
  } else if (b == d && ((e >= max(a, c) || e <= min(a, c)))) {
    cout << 2;
    return 0;
  } else if (b == f && ((c >= max(a, e) || c <= min(a, e)))) {
    cout << 2;
    return 0;
  } else if (d == f && ((a >= max(e, c) || a <= min(c, e)))) {
    cout << 2;
    return 0;
  } else if (a == c && ((f >= max(b, d) || f <= min(b, d)))) {
    cout << 2;
    return 0;
  } else if (a == e && ((d >= max(b, f) || d <= min(b, f)))) {
    cout << 2;
    return 0;
  } else if (e == c && ((b >= max(d, f) || b <= min(d, f)))) {
    cout << 2;
    return 0;
  } else
    cout << 3;
  return 0;
}
