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