#include <bits/stdc++.h>
using namespace std;
int n, col, num, mask[110], C[110], N[110], sol = 100;
char str[10];
vector<pair<int, int> > data;
int main(void) {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%s", str);
    if (str[0] == 'R')
      col = 0;
    else if (str[0] == 'G')
      col = 1;
    else if (str[0] == 'B')
      col = 2;
    else if (str[0] == 'Y')
      col = 3;
    else if (str[0] == 'W')
      col = 4;
    num = str[1] - '1';
    data.push_back(make_pair(col, num));
  }
  sort(data.begin(), data.end());
  data.erase(unique(data.begin(), data.end()), data.end());
  n = data.size();
  for (int i = 0; i < n; i++) {
    C[i] = data[i].first;
    N[i] = data[i].second;
  }
  for (int tc = 0; tc < (1 << 5); tc++) {
    for (int tn = 0; tn < (1 << 5); tn++) {
      vector<int> hints;
      for (int i = 0; i < 5; i++)
        if (tc & (1 << i)) hints.push_back(i);
      for (int i = 0; i < 5; i++)
        if (tn & (1 << i)) hints.push_back(~i);
      memset(mask, 0, sizeof(mask));
      for (int i = 0; i < hints.size(); i++) {
        for (int j = 0; j < n; j++) {
          if (hints[i] >= 0) {
            if (C[j] == hints[i]) mask[j] |= (1 << i);
          } else {
            if (N[j] == ~hints[i]) mask[j] |= (1 << i);
          }
        }
      }
      sort(mask, mask + n);
      bool flag = true;
      for (int i = 0; i < n - 1; i++) {
        if (mask[i] == mask[i + 1]) {
          flag = false;
          break;
        }
      }
      if (flag) sol = min(sol, (int)hints.size());
    }
  }
  printf("%d\n", sol);
}
