#include <bits/stdc++.h>
using namespace std;
int n, tmp, res;
string a[101];
int gt(char z) {
  if (z == 'R') return 0;
  if (z == 'G') return 1;
  if (z == 'B') return 2;
  if (z == 'Y') return 3;
  if (z == 'W') return 4;
  return (4 + z - '0');
}
int solve(int x) {
  int kt[10], count = 0, trues = 0, condi = 0;
  for (int i = 0; i <= 9; i++) {
    if (((x >> i) & 1) == 1) {
      kt[i] = 1;
      count++;
    } else
      kt[i] = 0;
  }
  for (int i = 1; i <= n - 1; i++) {
    for (int j = i + 1; j <= n; j++)
      if (a[i] != a[j]) {
        trues = 1;
        if ((a[i][0] != a[j][0]) and
            ((kt[gt(a[i][0])] == 1) or (kt[gt(a[j][0])] == 1)))
          trues = 0;
        if ((a[i][1] != a[j][1]) and
            ((kt[gt(a[i][1])] == 1) or (kt[gt(a[j][1])] == 1)))
          trues = 0;
        if (trues != 0) condi = 1;
        if (condi == 1) break;
      }
    if (condi == 1) break;
  }
  if (condi != 0) return 0;
  if (count < res) res = count;
  return 0;
}
int main() {
  scanf("%d\n", &n);
  res = 11;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 0; i <= 1023; i++) tmp = solve(i);
  cout << res;
  return 0;
}
