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