#include <bits/stdc++.h>
using namespace std;
pair<int, int> a[3];
int f() {
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < 3; j++) {
      if (i == j) continue;
      if (a[i].second == a[j].second) {
        int t;
        for (int k = 0; k < 3; k++) {
          if (k == i || k == j) continue;
          t = k;
        }
        if ((a[t].first > a[i].first && a[t].first < a[j].first) ||
            (a[t].first < a[i].first && a[t].first > a[j].first))
          return 0;
        else
          return 1;
      } else if (a[i].first == a[j].first) {
        int t;
        for (int k = 0; k < 3; k++) {
          if (k == i || k == j) continue;
          t = k;
        }
        if ((a[t].second > a[i].second && a[t].second < a[j].second) ||
            (a[t].second < a[i].second && a[t].second > a[j].second))
          return 0;
        else
          return 1;
      }
    }
  }
  return 0;
}
int main() {
  for (int i = 0; i < 3; i++) scanf("%d%d", &a[i].first, &a[i].second);
  if ((a[0].first == a[1].first && a[1].first == a[2].first &&
       a[0].first == a[2].first) ||
      (a[0].second == a[1].second && a[1].second == a[2].second &&
       a[0].second == a[2].second))
    printf("1\n");
  else if (f())
    printf("2\n");
  else
    printf("3\n");
  return 0;
}
