#include <bits/stdc++.h>
using namespace std;
int n, i, c[6][6], j, ans = 100;
int main() {
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    char a[2];
    scanf("%s", a);
    int x;
    if (a[0] == 'R') x = 0;
    if (a[0] == 'G') x = 1;
    if (a[0] == 'B') x = 2;
    if (a[0] == 'Y') x = 3;
    if (a[0] == 'W') x = 4;
    c[x][a[1] - '1'] = 1;
  }
  for (int i = 0; i <= (1 << 10); ++i) {
    int cnt = 0, flag = 1, a[15] = {0}, b[15] = {0};
    for (j = 0; j < 10; ++j) {
      if ((1 << j) & i) {
        a[j] = 1;
        cnt++;
      }
    }
    for (int k = 0; k < 5; ++k) {
      for (j = 0; j < 5; ++j) {
        if (c[k][j]) {
          if (a[k] && a[j + 5])
            ;
          else if (a[k])
            b[k]++;
          else if (a[j + 5])
            b[j + 5]++;
          else
            b[10]++;
        }
      }
    }
    for (j = 0; j <= 10; ++j) {
      if (b[j] > 1) flag = 0;
    }
    if (flag) {
      ans = min(ans, cnt);
    }
  }
  printf("%d", ans);
  return 0;
}
