#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int x1, y1, x2, y2, x3, y3;
  cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
  map<int, int> sx, sy;
  sx[x1]++;
  sx[x2]++;
  sx[x3]++;
  sy[y1]++;
  sy[y2]++;
  sy[y3]++;
  if (sx.size() == 1 || sy.size() == 1) {
    cout << 1;
    return 0;
  }
  if (sx.size() == 2) {
    int temp1 =
        sx.begin()->second == 2 ? sx.begin()->first : sx.rbegin()->first;
    int temp2 = x1 != temp1 ? y1 : (x2 != temp1 ? y2 : y3);
    if (min(y1, min(y2, y3)) >= temp2 || max(y1, max(y2, y3)) <= temp2)
      cout << 2;
    else
      cout << 3;
    return 0;
  }
  if (sy.size() == 2) {
    int temp1 =
        sy.begin()->second == 2 ? sy.begin()->first : sy.rbegin()->first;
    int temp2 = y1 != temp1 ? x1 : (y2 != temp1 ? x2 : x3);
    if (min(x1, min(x2, x3)) >= temp2 || max(x1, max(x2, x3)) <= temp2)
      cout << 2;
    else
      cout << 3;
    return 0;
  }
  cout << 3;
  return 0;
}
