#include <bits/stdc++.h>
using namespace std;
set<string>::iterator it, it2;
map<char, int> mp;
int n, re = 10;
void get(set<string>& st, int cur, int (&color)[5], int (&num)[6],
         int (&c_cnt)[5], int (&num_cnt)[6]) {
  if (st.size() <= 1) {
    re = min(re, cur);
    return;
  }
  set<string> tmp;
  int cnt = 0;
  for (int x = 1; x < (1 << 10); x++) {
    for (int y = 1, z = 0; y <= x; y = (y << 1), z++) {
      if (x & y) {
        cnt++;
        if (z < 5)
          color[z] = 1;
        else
          num[z - 4] = 1;
      }
    }
    for (it = st.begin(); it != st.end();) {
      int cur_c = mp[(*it)[0]];
      int cur_num = (*it)[1] - '0';
      if ((color[cur_c] && num[cur_num]) ||
          (color[cur_c] && c_cnt[cur_c] == 1) ||
          (num[cur_num] && num_cnt[cur_num] == 1)) {
        tmp.insert((*it));
        st.erase(it);
        c_cnt[cur_c]--;
        num_cnt[cur_num]--;
        it = st.begin();
      } else
        it++;
    }
    if (st.size() <= 1) re = min(re, cnt);
    for (it = tmp.begin(); it != tmp.end(); it++) {
      int cur_c = mp[(*it)[0]];
      int cur_num = (*it)[1] - '0';
      st.insert((*it));
      c_cnt[cur_c]++;
      num_cnt[cur_num]++;
    }
    tmp.clear();
    cnt = 0;
    fill(color, color + 5, 0);
    fill(num, num + 6, 0);
  }
}
void solve() {
  set<string> st;
  char s[11];
  int color[5], num[6], c_cnt[5], num_cnt[6];
  fill(color, color + 5, 0);
  fill(num, num + 6, 0);
  fill(c_cnt, c_cnt + 5, 0);
  fill(num_cnt, num_cnt + 6, 0);
  mp['R'] = 0;
  mp['G'] = 1;
  mp['B'] = 2;
  mp['Y'] = 3;
  mp['W'] = 4;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%s", s);
    st.insert(s);
  }
  for (it = st.begin(); it != st.end(); it++) {
    c_cnt[mp[(*it)[0]]]++;
    num_cnt[(*it)[1] - '0']++;
  }
  get(st, 0, color, num, c_cnt, num_cnt);
  printf("%d\n", re);
}
int main(void) {
  solve();
  return 0;
}
