#include <bits/stdc++.h>
using namespace std;
int main() {
  int ax, bx, cx, cy, by, ay;
  cin >> ax >> ay >> bx >> by >> cx >> cy;
  if (ax == bx && ax == cx) {
    cout << 1;
    return 0;
  }
  if (ay == by && ay == cy) {
    cout << 1;
    return 0;
  }
  if (ax == bx) {
    if ((cy < ay && cy > by) || (cy > ay && cy < by)) {
      cout << 3;
      return 0;
    }
    cout << 2;
    return 0;
  }
  if (ax == cx) {
    if ((by < ay && by > cy) || (by > ay && by < cy)) {
      cout << 3;
      return 0;
    }
    cout << 2;
    return 0;
  }
  if (cx == bx) {
    if ((ay < cy && ay > by) || (ay > cy && ay < by)) {
      cout << 3;
      return 0;
    }
    cout << 2;
    return 0;
  }
  if (ay == by) {
    if ((cx < ax && cx > bx) || (cx > ax && cx < bx)) {
      cout << 3;
      return 0;
    }
    cout << 2;
    return 0;
  }
  if (ay == cy) {
    if ((bx < ax && bx > cx) || (bx > ax && bx < cx)) {
      cout << 3;
      return 0;
    }
    cout << 2;
    return 0;
  }
  if (cy == by) {
    if ((ax < cx && ax > bx) || (ax > cx && ax < bx)) {
      cout << 3;
      return 0;
    }
    cout << 2;
    return 0;
  }
  cout << 3;
  return 0;
}
