#include <bits/stdc++.h>
using namespace std;
template <class T>
inline int size(const T& c) {
  return c.size();
}
using namespace std;
int fastMax(int x, int y) { return (((y - x) >> (32 - 1)) & (x ^ y)) ^ y; }
int fastMin(int x, int y) { return (((y - x) >> (32 - 1)) & (x ^ y)) ^ x; }
const int maxn = 100 + 10;
int n;
string st;
int res;
pair<int, int> a[maxn], c[maxn];
int cnt[10][10];
int cnt2[10][10];
int cnt3[10][10];
bool used[maxn];
bool check(int b, int b2) {
  memset(cnt2, 0, sizeof(cnt2));
  memset(cnt3, 0, sizeof(cnt3));
  for (int i = 1; i <= 5; i++)
    for (int j = 1; j <= 5; j++) cnt3[i][j] = cnt[i][j];
  for (int i = 1; i <= n; i++) {
    if ((b >> (a[i].first - 1)) & 1) c[i].first = a[i].first;
    if ((b2 >> (a[i].second - 1)) & 1) c[i].second = a[i].second;
    if (c[i].first != 0 && c[i].second != 0) cnt3[c[i].first][c[i].second]--;
    cnt2[c[i].first][c[i].second]++;
  }
  for (int i = 1; i <= 5; i++)
    if (cnt2[i][0] > 0) {
      int dem = 0;
      int vt = 0;
      for (int j = 1; j <= 5; j++) {
        if (cnt3[i][j] > 0) {
          dem++;
          vt = j;
        }
      }
      cnt3[i][vt] = 0;
      if (dem > 1) return false;
    }
  for (int i = 1; i <= 5; i++)
    if (cnt2[0][i] > 0) {
      int dem = 0;
      int vt = 0;
      for (int j = 1; j <= 5; j++) {
        if (cnt3[j][i] > 0) {
          dem++;
          vt = j;
        }
      }
      cnt3[vt][i] = 0;
      if (dem > 1) return false;
    }
  if (cnt2[0][0] > 0) {
    int dem = 0;
    for (int i = 1; i <= 5; i++)
      for (int j = 1; j <= 5; j++)
        if (cnt3[i][j] > 0) dem++;
    if (dem > 1) return false;
  }
  return true;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    cin >> st;
    if (st[0] == 'R') a[i].first = 1;
    if (st[0] == 'G') a[i].first = 2;
    if (st[0] == 'B') a[i].first = 3;
    if (st[0] == 'Y') a[i].first = 4;
    if (st[0] == 'W') a[i].first = 5;
    a[i].second = st[1] - '0';
    cnt[a[i].first][a[i].second]++;
  }
  res = 10;
  for (int b = 0; b <= (1 << 5) - 1; b++)
    for (int b2 = 0; b2 <= (1 << 5) - 1; b2++) {
      memset(c, 0, sizeof(c));
      memset(used, false, sizeof(used));
      if (check(b, b2))
        res = min(res, __builtin_popcount(b) + __builtin_popcount(b2));
    }
  cout << res << endl;
  fclose(stdin);
  fclose(stdout);
  return 0;
}
