#include <bits/stdc++.h>
using namespace std;
map<string, int> label;
class dsu {
 public:
  int n;
  vector<int> syn;
  vector<int> ant;
  dsu(int N) {
    n = N;
    syn = vector<int>(n, 0);
    ant = vector<int>(n, 0);
    for (int i = 0; i < n; ++i) syn[i] = i;
    for (int i = 0; i < n; ++i) ant[i] = i;
  }
  int get_super_parent_syn(int x) {
    if (syn[x] != x) syn[x] = get_super_parent_syn(syn[x]);
    return syn[x];
  }
  int get_super_parent_ant(int x) {
    if (ant[x] != x) ant[x] = get_super_parent_ant(ant[x]);
    return ant[x];
  }
  bool synonym(int a, int b) {
    return get_super_parent_syn(a) == get_super_parent_syn(b);
  }
  bool antonym(int a, int b) {
    return get_super_parent_ant(get_super_parent_syn(a)) ==
           get_super_parent_ant(get_super_parent_syn(b));
  }
  void merge_synonym(int a, int b) {
    int p1 = get_super_parent_syn(a);
    int p2 = get_super_parent_syn(b);
    syn[p1] = p2;
  }
  void merge_antonym(int a, int b) {
    int p1 = get_super_parent_syn(a);
    int p2 = get_super_parent_syn(b);
    ant[p1] = p2;
  }
  void printDsu() {
    for (auto node : syn) cout << node << " ";
    cout << endl;
    for (auto node : ant) cout << node << " ";
    cout << endl;
  }
};
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int a, b, c;
  int d, e, f;
  cin >> a >> d >> b >> e >> c >> f;
  if (a == b && a == c) {
    cout << 1 << endl;
    return 0;
  } else if (d == e && d == f) {
    cout << 1 << endl;
    return 0;
  }
  if (a == b) {
    if (f >= (max(d, e)) || f <= min(d, e)) {
      cout << 2 << endl;
    } else
      cout << 3 << endl;
  } else if (b == c) {
    if (d >= (max(e, f)) || d <= min(e, f)) {
      cout << 2 << endl;
    } else
      cout << 3 << endl;
  } else if (c == a) {
    if (e >= (max(d, f)) || e <= min(d, f)) {
      cout << 2 << endl;
    } else
      cout << 3 << endl;
  } else if (d == e) {
    if (c >= (max(a, b)) || c <= min(a, b)) {
      cout << 2 << endl;
    } else
      cout << 3 << endl;
  } else if (e == f) {
    if (a >= (max(b, c)) || a <= min(c, b)) {
      cout << 2 << endl;
    } else
      cout << 3 << endl;
  } else if (f == d) {
    if (b >= (max(a, c)) || b <= min(c, a)) {
      cout << 2 << endl;
    } else
      cout << 3 << endl;
  } else {
    cout << 3 << endl;
  }
}
