#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int>> v;
bool check1() {
  return ((v[0].first == v[1].first && v[1].first == v[2].first) ||
          (v[0].second == v[1].second && v[1].second == v[2].second));
}
bool check2() {
  if (v[0].first == v[1].first &&
      (v[2].second >= v[0].second && v[2].second >= v[1].second ||
       v[2].second <= v[0].second && v[2].second <= v[1].second))
    return 1;
  if (v[1].first == v[2].first &&
      (v[0].second >= v[1].second && v[0].second >= v[2].second ||
       v[0].second <= v[1].second && v[0].second <= v[2].second))
    return 1;
  if (v[0].first == v[2].first &&
      (v[1].second >= v[0].second && v[1].second >= v[2].second ||
       v[1].second <= v[0].second && v[1].second <= v[2].second))
    return 1;
  if (v[0].second == v[1].second &&
      (v[2].first >= v[0].first && v[2].first >= v[1].first ||
       v[2].first <= v[0].first && v[2].first <= v[1].first))
    return 1;
  if (v[1].second == v[2].second &&
      (v[0].first >= v[1].first && v[0].first >= v[2].first ||
       v[0].first <= v[1].first && v[0].first <= v[2].first))
    return 1;
  if (v[0].second == v[2].second &&
      (v[1].first >= v[0].first && v[1].first >= v[2].first ||
       v[1].first <= v[0].first && v[1].first <= v[2].first))
    return 1;
  return 0;
}
int main() {
  int x, y;
  while (~scanf("%d%d", &x, &y)) {
    v.push_back(make_pair(x, y));
    for (int i = 0; i < 2; i++) {
      scanf("%d%d", &x, &y);
      v.push_back(make_pair(x, y));
    }
    sort(v.begin(), v.end());
    if (check1())
      puts("1");
    else if (check2())
      puts("2");
    else
      puts("3");
    v.clear();
  }
  return 0;
}
