#include <bits/stdc++.h>
using namespace std;
const int maxN = (int)1e2 + 10;
const int inf = (int)1e9;
int x[maxN];
int y[maxN];
void answer(int x) {
  cout << x << '\n';
  exit(0);
}
int main() {
  for (int i = 0; i < 3; ++i) cin >> x[i] >> y[i];
  if (x[0] == x[1] && x[1] == x[2]) answer(1);
  if (y[0] == y[1] && y[1] == y[2]) answer(1);
  if (x[0] == x[1] && !(min(y[0], y[1]) < y[2] && y[2] < max(y[0], y[1])))
    answer(2);
  if (x[0] == x[2] && !(min(y[0], y[2]) < y[1] && y[1] < max(y[0], y[2])))
    answer(2);
  if (x[1] == x[2] && !(min(y[1], y[2]) < y[0] && y[0] < max(y[1], y[2])))
    answer(2);
  for (int i = 0; i < 3; ++i) swap(x[i], y[i]);
  if (x[0] == x[1] && !(min(y[0], y[1]) < y[2] && y[2] < max(y[0], y[1])))
    answer(2);
  if (x[0] == x[2] && !(min(y[0], y[2]) < y[1] && y[1] < max(y[0], y[2])))
    answer(2);
  if (x[1] == x[2] && !(min(y[1], y[2]) < y[0] && y[0] < max(y[1], y[2])))
    answer(2);
  answer(3);
  return 0;
}
