#include <bits/stdc++.h>
using namespace std;
int n, Min(13);
string x, now;
set<string> second;
string color = "RGBYW", num = "12345";
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  ;
  cin >> n;
  while (n--) {
    cin >> x;
    second.insert(x);
  }
  for (int mask = 0; mask < (1 << 10); ++mask) {
    set<string> temp;
    for (auto j : second) {
      now.clear();
      for (int i = 0; i < 5; ++i)
        if (((1 << i) & mask) && color[i] == j[0]) now.push_back(color[i]);
      for (int i = 0; i < 5; ++i)
        if (((1 << (i + 5)) & mask) && num[i] == j[1]) now.push_back(num[i]);
      temp.insert(now);
    }
    if (second.size() == temp.size()) Min = min(Min, __builtin_popcount(mask));
  }
  cout << Min << endl;
  return 0;
}
