#include <bits/stdc++.h>
using namespace std;
int n, a[105];
map<char, int> mp;
int main() {
  cin >> n;
  mp['R'] = 5;
  mp['G'] = 6;
  mp['B'] = 7;
  mp['Y'] = 8;
  mp['W'] = 9;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    int c, v;
    c = mp[s[0]];
    v = s[1] - '0' - 1;
    a[i] = (1 << c) | (1 << v);
  }
  sort(a, a + n);
  n = unique(a, a + n) - a;
  int ans = 11;
  for (int msk = 0; msk < (1 << 10); msk++) {
    bool f = true;
    for (int i = 0; i < n; i++) {
      for (int j = i + 1; j < n; j++) {
        int t = a[i] ^ a[j];
        if ((msk & t) == 0) {
          f = false;
          break;
        }
      }
      if (!f) break;
    }
    if (f) {
      ans = min(ans, __builtin_popcount(msk));
    }
  }
  cout << ans << endl;
  return 0;
}
