#include <bits/stdc++.h>
using namespace std;
const int mod = int(1e9) + 7, INF = 0x3fffffff, maxn = 5;
long long x[maxn], y[maxn];
long long ma[maxn], mi[maxn], mj[maxn], mk[maxn];
long long maxl = -1e10, minl = 1e10, maxy = -1e10, miny = 1e10;
long long midx, midy;
int result;
int main(void) {
  for (int i = 0; i < 3; i++) {
    scanf("%I64d%I64d", &x[i], &y[i]);
    maxl = max(maxl, x[i]);
    minl = min(minl, x[i]);
    maxy = max(maxy, y[i]);
    miny = min(miny, y[i]);
  }
  int k = 0, j = 0, a = 0, b = 0;
  for (int i = 0; i < 3; i++) {
    if (x[i] == maxl)
      ma[k++] = y[i];
    else if (x[i] == minl)
      mi[j++] = y[i];
    else {
      midx = x[i];
      midy = y[i];
    }
    if (y[i] == maxy)
      mj[a++] = x[i];
    else if (y[i] == miny)
      mk[b++] = x[i];
  }
  sort(ma, ma + k);
  sort(mi, mi + j);
  sort(mk, mk + b);
  sort(mj, mj + a);
  if (k == 3 || a == 3)
    result = 1;
  else if (k == 2) {
    if (ma[0] < mi[0] && ma[1] > mi[0])
      result = 3;
    else
      result = 2;
  } else if (j == 2) {
    if (ma[0] > mi[0] && ma[0] < mi[1])
      result = 3;
    else
      result = 2;
  } else if (a == 2) {
    if (mj[0] < mk[0] && mj[1] > mk[0])
      result = 3;
    else
      result = 2;
  } else if (b == 2) {
    if (mj[0] > mk[0] && mj[0] < mk[1])
      result = 3;
    else
      result = 2;
  } else if ((double)(midy - ma[0]) / (midx - maxl) ==
             (double)(ma[0] - mi[0]) / (maxl - minl))
    result = 1;
  else
    result = 3;
  printf("%d\n", result);
  return 0;
}
