#include <bits/stdc++.h>
using namespace std;
const int N = 1100;
int x[3], y[3];
set<int> xx, yy;
bool checkX(int first, int second, int third) {
  return (x[first] == x[second]) && (y[third] <= min(y[first], y[second]) ||
                                     y[third] >= max(y[first], y[second]));
}
bool checkY(int first, int second, int third) {
  return (y[first] == y[second]) && (x[third] <= min(x[first], x[second]) ||
                                     x[third] >= max(x[first], x[second]));
}
int main() {
  for (int i = 0; i < 3; ++i) {
    cin >> x[i] >> y[i];
    xx.insert(x[i]);
    yy.insert(y[i]);
  }
  if (xx.size() == 1 || yy.size() == 1) {
    puts("1");
  } else if ((xx.size() == 2 && yy.size() == 2)) {
    puts("2");
  } else {
    if (checkX(0, 1, 2) || checkY(0, 1, 2)) {
      puts("2");
    } else if (checkX(0, 2, 1) || checkY(0, 2, 1)) {
      puts("2");
    } else if (checkX(1, 2, 0) || checkY(1, 2, 0)) {
      puts("2");
    } else {
      puts("3");
    }
  }
  return 0;
}
