#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
int n;
int cnt[5][5];
int col[256];
int main() {
  col['R'] = 0;
  col['G'] = 1;
  col['B'] = 2;
  col['Y'] = 3;
  col['W'] = 4;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    char s[4];
    scanf("%s", s);
    cnt[col[s[0]]][s[1] - '1'] = 1;
  }
  int ans = 100;
  for (int i = 0; i < (1 << 5); i++)
    for (int j = 0; j < (1 << 5); j++) {
      int w = (i << 5) | j;
      int c = 0;
      for (int k = 0; k < 10; k++)
        if (w & (1 << k)) c++;
      int d = 0;
      set<int> s;
      for (int a = 0; a < 5; a++)
        for (int b = 0; b < 5; b++)
          if (cnt[a][b]) {
            d++;
            s.insert(((i & (1 << a)) << 5) | ((j & (1 << b))));
          }
      if (d == s.size()) {
        if (ans > c) ans = c;
      }
    }
  printf("%d\n", ans);
  return 0;
}
