#include <bits/stdc++.h>
const int N = 105;
char s[10];
int n, a[25], ans;
inline int idx(char *s) {
  int color, value = s[1] - '1';
  if (s[0] == 'R') color = 0;
  if (s[0] == 'G') color = 1;
  if (s[0] == 'B') color = 2;
  if (s[0] == 'Y') color = 3;
  if (s[0] == 'W') color = 4;
  return color * 5 + value;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%s", s + 1), ++a[idx(s + 1)];
  ans = 10;
  for (int opt = 0; opt < (1 << 10); ++opt) {
    bool flag = true;
    for (int i = 0; i < 25; ++i)
      if (a[i])
        for (int j = i + 1; j < 25; ++j)
          if (a[j]) {
            int ci = i / 5, vi = i % 5;
            int cj = j / 5, vj = j % 5;
            if (ci != cj && ((opt & (1 << ci)) || (opt & (1 << cj)))) continue;
            if (vi != vj && ((opt & (1 << vi + 5)) || (opt & (1 << vj + 5))))
              continue;
            flag = false;
            break;
          }
    if (!flag) continue;
    int res = 0;
    for (int i = 0; i < 10; ++i) res += (opt >> i) & 1;
    ans = std ::min(ans, res);
  }
  printf("%d\n", ans);
}
