#include <bits/stdc++.h>
using namespace std;
set<int> S[10];
vector<pair<int, int> > v;
char cards[5];
int sum(int m) {
  int c = 0;
  while (m) {
    if (m % 2) c++;
    m /= 2;
  }
  return c;
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%s", cards);
    int col, val;
    val = cards[1] - '1';
    if (cards[0] == 'R')
      col = 5;
    else if (cards[0] == 'G')
      col = 6;
    else if (cards[0] == 'B')
      col = 7;
    else if (cards[0] == 'Y')
      col = 8;
    else if (cards[0] == 'W')
      col = 9;
    v.push_back(make_pair(col, val));
  }
  sort(v.begin(), v.end());
  v.resize(unique(v.begin(), v.end()) - v.begin());
  int sz = (int)v.size();
  int res = (1 << 30), col, val, ex;
  for (int i = 0; i < (1 << 10); i++) {
    ex = 0;
    for (int j = 0; j < 10; j++) S[j].clear();
    for (int j = 0; j < sz; j++) {
      col = v[j].first;
      val = v[j].second;
      if ((i & (1 << col)) && (i & (1 << val))) continue;
      if ((i & (1 << col)) == 0 && (i & (1 << val))) S[val].insert(col);
      if ((i & (1 << col)) && (i & (1 << val)) == 0) S[col].insert(val);
      if ((i & (1 << col)) == 0 && (i & (1 << val)) == 0) ex++;
    }
    bool flag = 1;
    for (int j = 0; j < 10; j++)
      if ((int)S[j].size() > 1) flag = 0;
    if (ex > 1) flag = 0;
    if (flag) res = min(res, sum(i));
  }
  printf("%d\n", res);
}
