#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using pii = pair<int, int>;
using vi = vector<int>;
const int INF = 2e9;
const long long LINF = 9e18;
struct Point {
  int x;
  int y;
};
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  Point p1, p2, p3;
  cin >> p1.x >> p1.y >> p2.x >> p2.y >> p3.x >> p3.y;
  if ((p1.x == p2.x && p2.x == p3.x) || (p1.y == p2.y && p2.y == p3.y)) {
    cout << 1;
    return 0;
  }
  if ((p1.x == p2.x && (p3.y <= min(p1.y, p2.y) || p3.y >= max(p1.y, p2.y))) ||
      (p1.x == p3.x && (p2.y <= min(p1.y, p3.y) || p2.y >= max(p1.y, p3.y))) ||
      (p2.x == p3.x && (p1.y <= min(p2.y, p3.y) || p1.y >= max(p2.y, p3.y))) ||
      (p1.y == p2.y && (p3.x <= min(p1.x, p2.x) || p3.x >= max(p1.x, p2.x))) ||
      (p1.y == p3.y && (p2.x <= min(p1.x, p3.x) || p2.x >= max(p1.x, p3.x))) ||
      (p2.y == p3.y && (p1.x <= min(p2.x, p3.x) || p1.x >= max(p2.x, p3.x)))) {
    cout << 2;
    return 0;
  }
  cout << 3;
  return 0;
}
