#include <bits/stdc++.h>
using namespace std;
string A[102], T = "12345RGBYW";
int color[102], num[102], n;
int main() {
  cin >> n;
  string inp;
  for (int i = 0; i < n; i++) cin >> A[i];
  int ans = INT_MAX;
  vector<string> rem;
  for (int mask = 0; mask < (1 << 10); mask++) {
    memset(color, 0, sizeof color);
    memset(num, 0, sizeof num);
    rem.clear();
    for (int bit = 0; bit < 5; bit++) {
      if (mask & (1 << bit)) {
        for (int i = 0; i < n; i++) {
          if (A[i][1] == T[bit]) {
            num[i] = 1;
          }
        }
      }
    }
    for (int bit = 5; bit < 10; bit++) {
      if (mask & (1 << bit)) {
        for (int i = 0; i < n; i++) {
          if (A[i][0] == T[bit]) {
            color[i] = 1;
          }
        }
      }
    }
    for (int i = 0; i < n; i++) {
      for (int j = i + 1; j < n; j++) {
        if (A[i] == A[j]) continue;
        if ((color[i] || color[j]) && A[i][0] != A[j][0]) continue;
        if ((num[i] || num[j]) && A[i][1] != A[j][1]) continue;
        rem.push_back(A[i]);
        rem.push_back(A[j]);
      }
    }
    bool flag = true;
    for (int i = 1; i < rem.size(); i++) {
      if (rem[i] != rem[i - 1]) {
        flag = false;
        break;
      }
    }
    if (flag) {
      ans = min(ans, __builtin_popcount(mask));
    }
  }
  cout << ans << endl;
  return 0;
}
