#include <bits/stdc++.h>
using namespace std;
int main() {
  map<char, int> hash;
  hash['R'] = 0;
  hash['G'] = 1;
  hash['B'] = 2;
  hash['Y'] = 3;
  hash['W'] = 4;
  int n;
  scanf("%d", &n);
  vector<pair<int, int> > types;
  for (int i = 0; i < (n); ++i) {
    string s;
    cin >> s;
    types.push_back(make_pair(hash[s[0]], s[1] - '0'));
  }
  sort(types.begin(), types.end());
  types.erase(unique(types.begin(), types.end()), types.end());
  int ans = 0x3f3f3f3f;
  for (int mask = 0; mask < ((1 << 10)); ++mask) {
    int can = 0;
    vector<int> col((int)types.size(), 0);
    vector<int> num((int)types.size(), 0);
    for (int i = 0; i < ((int)types.size()); ++i) {
      if (mask & (1 << (types[i].first))) {
        col[i] = true;
      }
      if (mask & (1 << (types[i].second + 4))) {
        num[i] = true;
      }
    }
    for (int i = 0; i < ((int)types.size()); ++i) {
      if (col[i] and num[i]) {
        ++can;
        continue;
      }
      if (col[i]) {
        bool ok = true;
        for (int j = 0; j < ((int)types.size()); ++j)
          if (j != i and types[i].first == types[j].first) {
            if (types[i].second != types[j].second) {
              ok &= num[j];
            }
            if (!ok) break;
          }
        if (ok) {
          ++can;
          continue;
        }
      }
      if (num[i]) {
        bool ok = true;
        for (int j = 0; j < ((int)types.size()); ++j)
          if (j != i and types[i].second == types[j].second) {
            if (types[i].first != types[j].first) {
              ok &= col[j];
            }
            if (!ok) break;
          }
        if (ok) {
          ++can;
          continue;
        }
      }
    }
    if (can >= (int)types.size() - 1) {
      ans = min(ans, __builtin_popcount(mask));
    }
  }
  printf("%d\n", ans);
  return 0;
}
