#include <bits/stdc++.h>
using namespace std;
long long solve() {
  long long n, f, g, d, flag, ans = 100, a[5], b[5];
  string s;
  vector<long long> v[5];
  cin >> n;
  for (long long i = 0; i < n; i++) {
    cin >> s;
    if (s[0] == 'R') v[0].push_back(s[1] - '0');
    if (s[0] == 'G') v[1].push_back(s[1] - '0');
    if (s[0] == 'B') v[2].push_back(s[1] - '0');
    if (s[0] == 'Y') v[3].push_back(s[1] - '0');
    if (s[0] == 'W') v[4].push_back(s[1] - '0');
  }
  for (long long i = 0; i < (1 << 10); i++) {
    g = 0;
    d = 0;
    flag = 0;
    for (long long j = 0; j < 5; j++) {
      a[j] = 0;
      b[j] = 0;
    }
    for (long long j = 0; j < 5; j++) {
      if ((i >> j) & 1) {
        a[j] = 1;
        d++;
      }
    }
    for (long long j = 5; j < 10; j++) {
      if ((i >> j) & 1) {
        f = 0;
        d++;
        for (long long k = 0; k < v[j - 5].size(); k++) {
          if (a[v[j - 5][k] - 1] == 0) {
            f++;
            a[v[j - 5][k] - 1] = 2;
          }
        }
        if (f > 1) {
          flag = 1;
        }
        for (long long j = 0; j < 5; j++) a[j] = a[j] % 2;
      } else {
        for (long long k = 0; k < v[j - 5].size(); k++) {
          if (a[v[j - 5][k] - 1] == 0) {
            g++;
            a[v[j - 5][k] - 1] = 2;
          }
          if (a[v[j - 5][k] - 1] == 1) {
            b[v[j - 5][k] - 1]++;
            a[v[j - 5][k] - 1] = 3;
          }
        }
        if (g > 1) {
          flag = 1;
        }
        for (long long j = 0; j < 5; j++) a[j] = a[j] % 2;
      }
    }
    for (long long j = 0; j < 5; j++)
      if (b[j] > 1) flag = 1;
    if (!flag) ans = min(ans, d);
  }
  cout << ans;
  return 0;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long t = 1;
  while (t--) {
    solve();
    cout << "\n";
  }
}
