#include <bits/stdc++.h>
using namespace std;
const int Maxn = 100;
int N;
int mC[Maxn], mV[Maxn], eC[Maxn], eV[Maxn];
bool isTco(int a) {
  int ans = 0;
  for (int i = 0; i < N; i++)
    if ((mC[a] & eC[i]) && (mV[a] & eV[i]) &&
        (eV[a] != eV[i] || eC[a] != eC[i]))
      ans++;
  return (ans == 0);
}
bool isAllDet() {
  for (int i = 0; i < N; i++)
    if (isTco(i) == false) return false;
  return true;
}
bool check(int a) {
  for (int i = 0; i < N; i++) {
    if (eC[i] & (a >> 5))
      mC[i] = eC[i];
    else
      mC[i] = 31 & (~(a >> 5)) % 32;
  }
  for (int i = 0; i < N; i++)
    if (eV[i] & (a % 32))
      mV[i] = eV[i];
    else
      mV[i] = 31 & (~(a % 32));
  return isAllDet();
}
char tra[10] = {'R', 'G', 'B', 'Y', 'W'};
int main() {
  cin >> N;
  for (int i = 0; i < N; i++) {
    string a;
    cin >> a;
    for (int j = 0; j < 5; j++)
      if (a[0] == tra[j]) {
        eC[i] = 1 << j;
        break;
      }
    eV[i] = 1 << (int(a[1]) - int('1'));
  }
  int ans = 10;
  for (int i = 0; i < 1024; i++) {
    if (check(i) == true) ans = min(ans, __builtin_popcount(i));
    for (int j = 0; j < N; j++) mV[j] = mC[j] = 31;
  }
  cout << ans << endl;
}
