#include <bits/stdc++.h>
using namespace std;
bool debug = 1;
int n, m, k;
int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
long long ln, lk, lm;
set<string> cs;
int ans = (1 << 30);
string S = "RGBYW12345";
void cal(int sta) {
  map<string, int> mp;
  int ver = 0;
  for (auto s : cs) mp[s];
  for (int(i) = 0; (i) < (int)(10); (i)++)
    if ((sta >> i) & 1) {
      int j = (i < 5) ? 0 : 1;
      for (auto &p : mp) {
        if (S[i] == p.first[j]) p.second |= 1 << j;
      }
    }
  for (auto p : mp) {
    if (p.second == 3)
      ver++;
    else if (p.second == 2) {
      bool fg = 1;
      for (auto pp : mp)
        if (pp.first != p.first && pp.second == 2 &&
            pp.first[1] == p.first[1]) {
          fg = 0;
          break;
        }
      if (fg) ver++;
    }
    if (p.second == 1) {
      bool fg = 1;
      for (auto pp : mp)
        if (pp.first != p.first && pp.second == 1 &&
            pp.first[0] == p.first[0]) {
          fg = 0;
          break;
        }
      if (fg) ver++;
    }
  }
  if (ver + 1 < cs.size()) return;
  ans = min(ans, __builtin_popcount(sta));
}
int main() {
  cin >> n;
  string a;
  for (int(i) = 0; (i) < (int)(n); (i)++) {
    cin >> a;
    cs.insert(a);
  }
  for (int(i) = 0; (i) < (int)((1 << 10)); (i)++) cal(i);
  printf("%d\n", ans);
  return 0;
}
