#include <bits/stdc++.h>
using namespace std;
const int maxn = 105;
map<char, int> tb;
string s[maxn];
bool visit[11];
void init() {
  tb['1'] = 1;
  tb['2'] = 2;
  tb['3'] = 3;
  tb['4'] = 4;
  tb['5'] = 5;
  tb['R'] = 6;
  tb['G'] = 7;
  tb['B'] = 8;
  tb['Y'] = 9;
  tb['W'] = 10;
}
int main() {
  int i, j, k;
  int n;
  int ans = INT_MAX, tmp;
  ios::sync_with_stdio(false);
  init();
  cin >> n;
  for (i = 0; i < n; ++i) cin >> s[i];
  for (i = 0; i < (1 << 10); ++i) {
    tmp = 0;
    for (j = 0; j < 10; ++j) {
      if ((i >> j) & 1) {
        visit[j + 1] = true;
        ++tmp;
      } else {
        visit[j + 1] = false;
      }
    }
    if (tmp >= ans) continue;
    bool flag = true;
    for (j = 0; flag && j < n; ++j) {
      for (k = j + 1; flag && k < n; ++k) {
        if (s[j] == s[k]) continue;
        if (s[j][0] == s[k][0]) {
          if (!visit[tb[s[j][1]]] && !visit[tb[s[k][1]]]) flag = false;
        } else if (s[j][1] == s[k][1]) {
          if (!visit[tb[s[j][0]]] && !visit[tb[s[k][0]]]) flag = false;
        } else {
          if (!visit[tb[s[j][0]]] && !visit[tb[s[k][0]]] &&
              !visit[tb[s[j][1]]] && !visit[tb[s[k][1]]])
            flag = false;
        }
      }
    }
    if (flag) ans = tmp;
  }
  cout << ans << endl;
  return 0;
}
