#include <bits/stdc++.h>
using namespace std;
vector<int> get_bin(int n) {
  vector<int> ret;
  while (n > 0) {
    if (n % 2 == 0)
      ret.push_back(0);
    else
      ret.push_back(1);
    n /= 2;
  }
  return ret;
}
int main() {
  int t;
  t = 1;
  while (t--) {
    vector<pair<int, int> > pts;
    for (int i = 0; i < 3; i++) {
      int x, y;
      cin >> x >> y;
      pts.push_back({x, y});
    }
    set<pair<int, int> > sm_x;
    set<pair<int, int> > sm_y;
    if (pts[0].first == pts[1].first) sm_x.insert(pts[0]), sm_x.insert(pts[1]);
    if (pts[1].first == pts[2].first) sm_x.insert(pts[1]), sm_x.insert(pts[2]);
    if (pts[0].first == pts[2].first) sm_x.insert(pts[0]), sm_x.insert(pts[2]);
    if (pts[0].second == pts[1].second)
      sm_y.insert(pts[0]), sm_y.insert(pts[1]);
    if (pts[1].second == pts[2].second)
      sm_y.insert(pts[1]), sm_y.insert(pts[2]);
    if (pts[0].second == pts[2].second)
      sm_y.insert(pts[0]), sm_y.insert(pts[2]);
    if (sm_x.size() == 3 || sm_y.size() == 3)
      cout << 1 << endl;
    else if (sm_x.size() == 2) {
      int y1 = min((*(sm_x.begin())).second, (*(++sm_x.begin())).second);
      int y2 = max((*(sm_x.begin())).second, (*(++sm_x.begin())).second);
      int y3 = pts[0].second + pts[1].second + pts[2].second - y1 - y2;
      if (y3 >= y2 || y3 <= y1)
        cout << 2 << endl;
      else
        cout << 3 << endl;
    } else if (sm_y.size() == 2) {
      int x1 = min((*(sm_y.begin())).first, (*(++sm_y.begin())).first);
      int x2 = max((*(sm_y.begin())).first, (*(++sm_y.begin())).first);
      int x3 = pts[0].first + pts[1].first + pts[2].first - x1 - x2;
      if (x3 >= x2 || x3 <= x1)
        cout << 2 << endl;
      else
        cout << 3 << endl;
    } else
      cout << 3 << endl;
  }
  return 0;
}
