#include <bits/stdc++.h>
using namespace std;
char str[] = "RGBYW";
int f(char a) {
  for (int i = 0; i < 5; i++)
    if (str[i] == a) return i;
}
int n;
int num[222], c[222];
int main() {
  cin >> n;
  vector<pair<int, int> > p;
  p.resize(n);
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    int j = f(s[0]);
    int k = s[1] - '1' + 5;
    p[i] = make_pair(j, k);
  }
  sort(p.begin(), p.end());
  p.resize(unique(p.begin(), p.end()) - p.begin());
  n = p.size();
  for (int i = 0; i < n; i++) c[i] = p[i].first, num[i] = p[i].second;
  int ans = 10;
  for (int tn = 0; tn < 32; tn++)
    for (int tc = 0; tc < 32; tc++) {
      vector<int> hints;
      int t = 0;
      for (int i = 0; i < 5; i++) {
        if (tn & (1 << i)) hints.push_back(i);
        if (tc & (1 << i)) hints.push_back(i + 5);
      }
      int mask[222];
      memset(mask, 0, sizeof mask);
      for (int i = 0; i < hints.size(); i++) {
        for (int j = 0; j < n; j++) {
          if (num[j] == hints[i] || c[j] == hints[i]) mask[j] |= (1 << i);
        }
      }
      sort(mask, mask + n);
      bool ok = 1;
      for (int i = 0; i < n - 1; i++)
        if (mask[i] == mask[i + 1]) ok = 0;
      if (ok) ans = min(ans, (int)hints.size());
    }
  cout << ans << endl;
}
