#include <bits/stdc++.h>
using namespace std;
const int maxn = 10;
inline long long read() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + ch - 48;
    ch = getchar();
  }
  return x * f;
}
struct P {
  long long x, y;
} a[maxn];
int main(void) {
  cin.tie(0);
  std::ios::sync_with_stdio(false);
  for (long long i = 1; i <= 3; i++) {
    cin >> a[i].x >> a[i].y;
  }
  if (a[1].x == a[2].x && a[2].x == a[3].x) {
    cout << "1"
         << "\n";
  } else if (a[1].y == a[2].y && a[2].y == a[3].y) {
    cout << "1"
         << "\n";
  } else {
    bool flag = 0;
    long long numx = 0;
    long long numy = 0;
    for (long long i = 1; i <= 3; i++) {
      for (long long j = i + 1; j <= 3; j++) {
        if (a[i].x == a[j].x) {
          flag = 1;
          numx++;
        }
        if (a[i].y == a[j].y) {
          flag = 1;
          numy++;
        }
      }
    }
    if (flag == 0) {
      cout << "3"
           << "\n";
    } else {
      if (numx && numy)
        cout << "2"
             << "\n";
      else {
        if (numx) {
          long long pos = 0;
          bool ok = 0;
          if (a[1].x == a[2].x) pos = 3;
          if (a[1].x == a[3].x) pos = 2;
          if (a[2].x == a[3].x) pos = 1;
          if (pos == 1) {
            if ((a[pos].y > a[2].y && a[pos].y < a[3].y) ||
                (a[pos].y > a[3].y && a[pos].y < a[2].y)) {
              ok = 1;
            }
          }
          if (pos == 2) {
            if ((a[pos].y > a[1].y && a[pos].y < a[3].y) ||
                (a[pos].y > a[3].y && a[pos].y < a[1].y)) {
              ok = 1;
            }
          }
          if (pos == 3) {
            if ((a[pos].y > a[2].y && a[pos].y < a[1].y) ||
                (a[pos].y > a[1].y && a[pos].y < a[2].y)) {
              ok = 1;
            }
          }
          if (ok)
            cout << "3"
                 << "\n";
          else
            cout << "2"
                 << "\n";
        } else if (numy) {
          long long pos = 0;
          bool ok = 0;
          if (a[1].y == a[2].y) pos = 3;
          if (a[1].y == a[3].y) pos = 2;
          if (a[2].y == a[3].y) pos = 1;
          if (pos == 1) {
            if ((a[pos].x > a[2].x && a[pos].x < a[3].x) ||
                (a[pos].x > a[3].x && a[pos].x < a[2].x)) {
              ok = 1;
            }
          }
          if (pos == 2) {
            if ((a[pos].x > a[1].x && a[pos].x < a[3].x) ||
                (a[pos].x > a[3].x && a[pos].x < a[1].x)) {
              ok = 1;
            }
          }
          if (pos == 3) {
            if ((a[pos].x > a[2].x && a[pos].x < a[1].x) ||
                (a[pos].x > a[1].x && a[pos].x < a[2].x)) {
              ok = 1;
            }
          }
          if (ok)
            cout << "3"
                 << "\n";
          else
            cout << "2"
                 << "\n";
        }
      }
    }
  }
  return 0;
}
