#include <bits/stdc++.h>
using namespace std;
long long max(long long a, long long b) {
  if (a > b) return a;
  return b;
}
long long x[3], y[3];
long long ctr = 0;
char ch;
long long num1, num2;
long long min(long long a, long long b) { return a + b - max(a, b); }
bool possible(long long arr[3]) {
  if (arr[0] == arr[1] && arr[1] == arr[2]) return true;
  return false;
}
long long last;
void possible1(long long arr[3]) {
  if (arr[0] == arr[1] || arr[1] == arr[2] || arr[2] == arr[0]) {
    if (arr[0] == x[0]) {
      ch = 'x';
      if (arr[0] == arr[1]) {
        num1 = y[0];
        num2 = y[1];
        last = y[2];
      } else if (arr[1] == arr[2]) {
        num1 = y[1];
        num2 = y[2];
        last = y[0];
      } else {
        num1 = y[2];
        num2 = y[0];
        last = y[1];
      }
    } else {
      if (arr[0] == y[0]) {
        ch = 'x';
        if (arr[0] == arr[1]) {
          num1 = x[0];
          num2 = x[1];
          last = x[2];
        } else if (arr[1] == arr[2]) {
          num1 = x[1];
          num2 = x[2];
          last = x[0];
        } else {
          num1 = x[2];
          num2 = x[0];
          last = x[1];
        }
      }
    }
    ctr++;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> x[0] >> y[0];
  cin >> x[1] >> y[1];
  cin >> x[2] >> y[2];
  possible1(x);
  possible1(y);
  if (possible(x) || possible(y)) {
    cout << 1;
    return 0;
  } else if (ctr >= 2)
    cout << 2;
  else if (ctr == 1) {
    if ((last >= num1 && last <= num2) || last >= num2 && last <= num1)
      cout << 3;
    else
      cout << 2;
    return 0;
  } else
    cout << 3;
}
