#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int nmax = 100005;
const long long inf = 1e9;
const double eps = 1e-6;
string s[105];
int us[10];
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> s[i];
  }
  int ans = 100;
  for (int mask = 0; mask < (1 << 10); ++mask) {
    int cnt = 0;
    for (int i = 0; i < 10; ++i) {
      if (mask & (1 << i)) {
        cnt++;
        us[i] = 1;
      } else
        us[i] = 0;
    }
    if (cnt >= ans) continue;
    bool ok = 1;
    for (int i = 0; i < n; ++i) {
      for (int j = i + 1; j < n; ++j) {
        if (s[i] == s[j]) continue;
        if (s[i][0] == s[j][0]) {
          if (!us[s[i][1] - '1' + 5] && !us[s[j][1] - '1' + 5]) {
            ok = 0;
          }
        } else if (s[i][1] == s[j][1]) {
          int ind1, ind2;
          if (s[i][0] == 'R')
            ind1 = 0;
          else if (s[i][0] == 'G')
            ind1 = 1;
          else if (s[i][0] == 'B')
            ind1 = 2;
          else if (s[i][0] == 'Y')
            ind1 = 3;
          else
            ind1 = 4;
          if (s[j][0] == 'R')
            ind2 = 0;
          else if (s[j][0] == 'G')
            ind2 = 1;
          else if (s[j][0] == 'B')
            ind2 = 2;
          else if (s[j][0] == 'Y')
            ind2 = 3;
          else
            ind2 = 4;
          if (!us[ind1] && !us[ind2]) {
            ok = 0;
          }
        } else {
          int ind1, ind2;
          if (s[i][0] == 'R')
            ind1 = 0;
          else if (s[i][0] == 'G')
            ind1 = 1;
          else if (s[i][0] == 'B')
            ind1 = 2;
          else if (s[i][0] == 'Y')
            ind1 = 3;
          else
            ind1 = 4;
          if (s[j][0] == 'R')
            ind2 = 0;
          else if (s[j][0] == 'G')
            ind2 = 1;
          else if (s[j][0] == 'B')
            ind2 = 2;
          else if (s[j][0] == 'Y')
            ind2 = 3;
          else
            ind2 = 4;
          if (!us[ind1] && !us[ind2] && !us[s[i][1] - '1' + 5] &&
              !us[s[j][1] - '1' + 5]) {
            ok = 0;
          }
        }
      }
      if (!ok) break;
    }
    if (ok) ans = cnt;
  }
  cout << ans << '\n';
  return 0;
}
