#include <bits/stdc++.h>
using namespace std;
const int INF = 1011110000;
struct Pr {
  int x, y;
} cd[111];
int n;
char* chh = "RGBYW";
char str[11];
bool know[111];
bool check(int s) {
  memset(know, 0, sizeof(know));
  for (int i = 0; i < n; i++)
    if ((s & (1 << cd[i].x)) && (s & (1 << (cd[i].y + 5)))) know[i] = 1;
  for (int i = 0; i < n; i++) {
    if (know[i]) continue;
    if (s & (1 << cd[i].x)) {
      bool other = 0;
      for (int j = 0; j < n; j++) {
        if (know[j]) continue;
        if (cd[i].x == cd[j].x && cd[j].y != cd[i].y) {
          other = 1;
        }
      }
      if (!other) know[i] = 1;
    } else if (s & (1 << (cd[i].y + 5))) {
      bool other = 0;
      for (int j = 0; j < n; j++) {
        if (know[j]) continue;
        if (cd[i].y == cd[j].y && cd[j].x != cd[i].x) other = 1;
      }
      if (!other) know[i] = 1;
    }
  }
  for (int i = 0; i < n; i++) {
    bool other = 0;
    for (int j = 0; j < n; j++) {
      if (know[j]) continue;
      if (cd[j].x != cd[i].x || cd[i].y != cd[j].y) other = 1;
    }
    if (!other) know[i] = 1;
  }
  for (int i = 0; i < n; i++)
    if (!know[i]) return 0;
  return 1;
}
int chId(char ch) {
  for (int i = 0; i < strlen(chh); i++)
    if (ch == chh[i]) return i;
}
void input() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    scanf("%s", str);
    cd[i].x = chId(str[0]);
    cd[i].y = str[1] - '1';
  }
}
void solve() {
  int res = INF;
  for (int s = 0; s < (1 << 10); s++) {
    int tres = 0;
    for (int j = 0; j < 10; j++)
      if (s & (1 << j)) tres++;
    if (check(s)) {
      if (tres < res) {
        res = tres;
      }
    }
  }
  printf("%d\n", res);
}
int main() {
  input();
  solve();
  return 0;
}
