#include <bits/stdc++.h>
using namespace std;
int main() {
  signed long long int x1, y1, x2, y2, x3, y3;
  cin >> x1 >> y1;
  cin >> x2 >> y2;
  cin >> x3 >> y3;
  if (x1 == x2 && x1 == x3) {
    cout << 1 << endl;
  } else if (y1 == y2 && y1 == y3) {
    cout << 1 << endl;
  } else if ((x1 == x2 && (y3 <= min(y1, y2) || y3 >= max(y1, y2))) ||
             (x1 == x3 && (y2 <= min(y1, y3) || y2 >= max(y1, y3))) ||
             (x3 == x2 && (y1 <= min(y3, y2) || y1 >= max(y3, y2))) ||
             (y1 == y2 && (x3 <= min(x1, x2) || x3 >= max(x1, x2))) ||
             (y1 == y3 && (x2 <= min(x1, x3) || x2 >= max(x1, x3))) ||
             (y3 == y2 && (x1 <= min(x3, x2) || x1 >= max(x3, x2)))) {
    cout << 2 << endl;
  } else {
    cout << 3 << endl;
  }
  return 0;
}
