#include <bits/stdc++.h>
using namespace std;
const int inf = 1000000000;
const int MOD = 1000000007;
const double pi = acos(-1.0);
string s[111];
set<string> mem[222];
int main() {
  int n;
  cin >> n;
  for (int i = (0); i <= (n - 1); ++i) cin >> s[i];
  char f[] = {'R', 'G', 'B', 'Y', 'W', '1', '2', '3', '4', '5'};
  int ans = 10;
  for (int mask = (0); mask <= ((1 << 10) - 1); ++mask) {
    int bits = 0;
    for (int i = (0); i <= (9); ++i)
      if (mask & (1 << i)) bits++;
    set<char> cur;
    for (int i = (0); i <= (9); ++i)
      if (mask & (1 << i)) cur.insert(f[i]);
    for (int i = (0); i <= (200); ++i) mem[i].clear();
    bool ok = true;
    for (int i = (0); i <= (n - 1); ++i) {
      if (cur.count(s[i][0]) && cur.count(s[i][1]))
        ;
      else if (cur.count(s[i][0]))
        mem[s[i][0]].insert(s[i]);
      else if (cur.count(s[i][1]))
        mem[s[i][1]].insert(s[i]);
      else
        mem[0].insert(s[i]);
    }
    for (int i = (0); i <= (200); ++i)
      if ((int)((mem[i]).size()) > 1) ok = false;
    if (ok) ans = min(ans, bits);
  }
  cout << ans << endl;
}
