#include <bits/stdc++.h>
using namespace std;
bool guse[11];
bool used[11];
vector<int> g[11];
int a[101];
int b[101];
char c[101];
int n;
int coun(int mask) {
  int res = 0;
  while (mask > 0) {
    if (mask % 2 == 1) res++;
    mask /= 2;
  }
  return res;
}
bool prove(int mask) {
  int i = 1;
  while (mask > 0) {
    if (mask % 2 == 1) used[i] = true;
    mask /= 2;
    i++;
  }
  bool flag = true;
  for (i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (((b[i] == b[j]) || !used[b[i]] && !used[b[j]]) &&
          ((a[i] == a[j]) || !used[5 + a[i]] && !used[5 + a[j]]) &&
          !(a[i] == a[j] && b[i] == b[j]))
        flag = false;
    }
  }
  return flag;
}
int main() {
  set<pair<int, int> > s;
  int mi = 10, mask = 0;
  cin >> n;
  for (int i = 0; i < 10; i++) guse[i] = false;
  for (int i = 0; i < n; i++) {
    cin >> c[i];
    if (c[i] == '\n' || c[i] == ' ') cin >> c[i];
    cin >> b[i];
    if (c[i] == 'G') a[i] = 1, guse[1] = true;
    if (c[i] == 'R') a[i] = 2, guse[2] = true;
    if (c[i] == 'B') a[i] = 3, guse[3] = true;
    if (c[i] == 'Y') a[i] = 4, guse[4] = true;
    if (c[i] == 'W') a[i] = 5, guse[5] = true;
    if (b[i] == 1) guse[6] = true;
    if (b[i] == 2) guse[7] = true;
    if (b[i] == 3) guse[8] = true;
    if (b[i] == 4) guse[9] = true;
    if (b[i] == 5) guse[10] = true;
    if (s.find(make_pair(a[i], b[i])) == s.end()) {
      g[a[i]].push_back(5 + b[i]);
      g[5 + b[i]].push_back(a[i]);
      s.insert(make_pair(a[i], b[i]));
    }
  }
  for (mask = 0; mask < 1024; mask++) {
    for (int i = 1; i <= 10; i++) used[i] = false;
    if (prove(mask)) mi = min(coun(mask), mi);
  }
  cout << mi;
  return 0;
}
