#include <bits/stdc++.h>
using namespace std;
long long powmod(long long a, long long b) {
  if (b == 0) return 1;
  long long x = powmod(a, b / 2);
  long long y = (x * x) % 1000000007;
  if (b % 2) return (a * y) % 1000000007;
  return y % 1000000007;
}
int main() {
  set<int> st1;
  set<int> st2;
  int x1, x2, x3, y1, y2, y3;
  cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
  st1.insert(x1);
  st1.insert(x2);
  st1.insert(x3);
  st2.insert(y1);
  st2.insert(y2);
  st2.insert(y3);
  int ans;
  if ((long long)st1.size() == 1 || (long long)st2.size() == 1) ans = 1;
  if ((long long)st1.size() == 2 && (long long)st2.size() == 2) ans = 2;
  if ((long long)st1.size() == 3 && (long long)st2.size() == 3) ans = 3;
  if ((long long)st1.size() == 2 && (long long)st2.size() == 3) {
    if (x1 == x2 && (y3 > max(y1, y2) || y3 < min(y1, y2)))
      ans = 2;
    else if (x2 == x3 && (y1 > max(y2, y3) || y1 < min(y2, y3)))
      ans = 2;
    else if (x1 == x3 && (y2 > max(y1, y3) || y2 < min(y1, y3)))
      ans = 2;
    else
      ans = 3;
  }
  if ((long long)st1.size() == 3 && (long long)st2.size() == 2) {
    if (y1 == y2 && (x3 > max(x1, x2) || x3 < min(x1, x2)))
      ans = 2;
    else if (y2 == y3 && (x1 > max(x2, x3) || x1 < min(x2, x3)))
      ans = 2;
    else if (y1 == y3 && (x2 > max(x1, x3) || x2 < min(x1, x3)))
      ans = 2;
    else
      ans = 3;
  }
  printf("%d\n", ans);
  return 0;
}
