#include <bits/stdc++.h>
long double p = 3.14159265358979323, eps = 0.000000001;
using namespace std;
long long n, q, w, e;
string s, s1;
long long res, sum, x, y, z, el[4];
struct point {
  long long x, y;
};
pair<long long, long long> pt[3];
point a, b, c, d, a1, b1;
int sr(double x, double y) {
  if (x > y + eps) return 1;
  if (fabs(x - y) < eps) return 0;
  if (x + eps < y) return -1;
}
long long dist(long long x, long long y, long long x2, long long y2) {
  return (x2 - x) * (x2 - x) + (y2 - y) * (y2 - y);
}
void init() {
  for (int i = 0; i < 3; ++i) cin >> pt[i].first >> pt[i].second;
  sort(pt, pt + 3);
  a.x = pt[0].first;
  a.y = pt[0].second;
  b.x = pt[1].first;
  b.y = pt[1].second;
  c.x = pt[2].first;
  c.y = pt[2].second;
  b.x -= a.x;
  c.x -= a.x;
  b.y -= a.y;
  c.y -= a.y;
  a.x = a.y = 0;
  q = -b.y;
  w = b.x;
  if (c.x * q + c.y * w == 0) {
    res = 1;
    return;
  }
  el[0] = dist(a.x, a.y, b.x, b.y);
  el[1] = dist(b.x, b.y, c.x, c.y);
  el[2] = dist(c.x, c.y, a.x, a.y);
  sort(el, el + 3);
  x = el[0];
  y = el[1];
  z = el[2];
  if (z < x + y) {
    res = 3;
    return;
  }
  if (((a.y > b.y && a.y < c.y || a.y > c.y && a.y < b.y) && b.x == c.x ||
       (c.y > b.y && c.y < a.y || c.y > a.y && c.y < b.y) && b.x == a.x ||
       (b.x > a.x && b.x < c.x) && a.y == c.y) &&
      (!b.x || !b.y || !c.x || !c.y || !(b.x - c.x) || !(b.y - c.y))) {
    res = 3;
    return;
  }
  if (!b.x || !b.y || !c.x || !c.y || !(b.x - c.x) || !(b.y - c.y)) {
    res = 2;
    return;
  }
  res = 3;
}
void output() { cout << res << endl; }
int main() {
  init();
  output();
  return 0;
}
