#include <bits/stdc++.h>
using namespace std;
int a[101], b[101];
int n;
int solve(int x) {
  int cnt = 1;
  int vis[11];
  memset(vis, 0, sizeof vis);
  while (x) {
    if (x & 1) vis[cnt] = 1;
    cnt++;
    x >>= 1;
  }
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      if (i == j) continue;
      int flag = 0;
      if (a[i] != a[j] || b[i] != b[j]) {
        if (a[i] != a[j]) {
          if (vis[a[i]] + vis[a[j]] == 0) {
            if (b[i] == b[j])
              return 0;
            else {
              if (vis[b[i]] + vis[b[j]] == 0) return 0;
            }
          }
        } else {
          if (vis[b[i]] + vis[b[j]] == 0) return 0;
        }
      }
    }
  }
  return 1;
}
int mp(string s) {
  if (s[0] == 'G') return 6;
  if (s[0] == 'R') return 7;
  if (s[0] == 'W') return 8;
  if (s[0] == 'Y') return 9;
  if (s[0] == 'B') return 10;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    a[i] = mp(s);
    b[i] = s[1] - '0';
  }
  int ans = 10;
  for (int i = 0; i < 1 << 10; i++) {
    if (solve(i)) {
      int tmpi = i;
      int cnt = 0;
      while (tmpi) {
        if (tmpi & 1) cnt++;
        tmpi >>= 1;
      }
      ans = min(ans, cnt);
    }
  }
  cout << ans << endl;
  return 0;
}
