#include <bits/stdc++.h>
using namespace std;
template <class T>
void printImpl(const vector<T>& coll) {
  copy(coll.begin(), coll.end(), ostream_iterator<T>(cout, " "));
  cout << endl;
}
template <class T>
void printImpl(const set<T>& coll) {
  copy(coll.begin(), coll.end(), ostream_iterator<T>(cout, " "));
  cout << endl;
}
template <class T, int N>
void printImpl(T (&coll)[N]) {
  copy(coll, coll + N, ostream_iterator<T>(cout, " "));
  cout << endl;
}
template <class Key, class Value>
void printImpl(const map<Key, Value>& data) {
  typename map<Key, Value>::const_iterator it;
  for (it = data.begin(); it != data.end(); ++it) {
    cout << it->first << ":" << it->second << endl;
  }
}
template <class T>
void printImpl(const T& data) {
  cout << data << endl;
}
int main() {
  int N;
  cin >> N;
  vector<string> s(N);
  for (int i = 0; i < (N); ++i) cin >> s[i];
  char cc[] = {'B', 'Y', 'W', 'G', 'R'};
  int res = 10;
  for (int t = 0; t < (1024); ++t) {
    set<char> tested;
    for (int i = 0; i < (10); ++i) {
      if (t & (1 << i)) {
        if (i < 5) {
          tested.insert(cc[i]);
        } else {
          tested.insert('1' + i - 5);
        }
      }
    }
    bool ok = true;
    for (int i = 0; i < N - 1; ++i) {
      for (int j = i + 1; j < N; ++j) {
        string s1 = s[i];
        string s2 = s[j];
        if (s1 == s2) continue;
        if (s1[0] == s2[0]) {
          if (0 == tested.count(s1[1]) && 0 == tested.count(s2[1])) {
            ok = false;
            break;
          }
        } else if (s1[1] == s2[1]) {
          if (0 == tested.count(s1[0]) && 0 == tested.count(s2[0])) {
            ok = false;
            break;
          }
        } else {
          if (0 == tested.count(s1[0]) && 0 == tested.count(s1[1]) &&
              0 == tested.count(s2[0]) && 0 == tested.count(s2[1])) {
            ok = false;
            break;
          }
        }
      }
      if (!ok) break;
    }
    if (ok) {
      int cRes = 0;
      for (int i = 0; i < (10); ++i) {
        if (t & (1 << i)) cRes++;
      }
      if (cRes < res) res = cRes;
    }
  }
  cout << res << endl;
  return 0;
}
