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