#include <bits/stdc++.h>
using namespace std;
long long MOD = 1000000007;
std::vector<std::pair<int, int> > v;
bool bet(int x, int a, int b) {
  if (b > a) swap(a, b);
  if (x < a && x > b) return false;
  return true;
}
int main() {
  for (int i = 0; i < 3; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    v.push_back(std::make_pair(x, y));
  }
  if ((v[0].first == v[1].first and v[1].first == v[2].first) ||
      (v[0].second == v[1].second and v[1].second == v[2].second)) {
    printf("1\n");
    return 0;
  } else {
    for (int i = 0; i < 3; i++) {
      for (int j = i + 1; j < 3; j++) {
        int k = -1;
        for (int l = 0; l < 3; l++)
          if (l != i && l != j) k = l;
        if ((v[i].first == v[j].first &&
             bet(v[k].second, v[i].second, v[j].second)) ||
            (v[i].second == v[j].second &&
             bet(v[k].first, v[i].first, v[j].first))) {
          printf("2\n");
          return 0;
        }
      }
    }
    printf("3\n");
  }
  return 0;
}
