#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-10;
const int maxn = 1e6 + 5;
const int N = 1e4 + 5;
const int mod = 1e8;
char s[5];
int mp[11][11], cnt[11];
int change(char ch) {
  if (ch == 'R') return 5;
  if (ch == 'G') return 6;
  if (ch == 'B') return 7;
  if (ch == 'Y') return 8;
  if (ch == 'W') return 9;
}
int main(void) {
  int n;
  cin >> n;
  memset(mp, 0, sizeof(mp));
  for (int i = 1; i <= n; i++) {
    cin >> s;
    int x = s[1] - '1';
    int y = change(s[0]);
    mp[x][y] = 1;
  }
  int ans = 10;
  for (int S = 0; S < (1 << 10); S++) {
    int tmp = 0, flag = 1, cnt_ = 0;
    memset(cnt, 0, sizeof(cnt));
    for (int i = 0; i < 10; i++)
      if (S & (1 << i)) tmp++;
    if (tmp > ans) continue;
    for (int i = 0; i < 5; i++) {
      for (int j = 2; j < 10; j++) {
        if (mp[i][j]) {
          if ((S & (1 << i)) && (S & (1 << j)))
            continue;
          else if (S & (1 << i)) {
            cnt[i]++;
            if (cnt[i] > 1) flag = 0;
          } else if (S & (1 << j)) {
            cnt[j]++;
            if (cnt[j] > 1) flag = 0;
          } else {
            cnt_++;
            if (cnt_ > 1) flag = 0;
          }
        }
      }
    }
    if (flag) ans = min(ans, tmp);
  }
  cout << ans << endl;
  return 0;
}
