#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int MAXN = 20;
const double eps = 1e-10;
const long long MOD = 1e9 + 7;
int main() {
  int N;
  char s[10];
  while (~scanf("%d", &N)) {
    set<int> card;
    for (int i = 0; i < (N); ++i) {
      scanf("%s", s);
      int y = s[1] - '0', x;
      if (s[0] == 'R') x = 1;
      if (s[0] == 'G') x = 2;
      if (s[0] == 'B') x = 3;
      if (s[0] == 'Y') x = 4;
      if (s[0] == 'W') x = 5;
      card.insert(x * 10 + y);
    }
    int ans = INF;
    for (int mask = 0; mask < ((1 << 10)); ++mask) {
      vector<int> x, y;
      for (int i = 0; i < (5); ++i)
        if (mask & (1 << i)) x.push_back(i + 1);
      for (int i = (5); i <= (9); ++i)
        if (mask & (1 << i)) y.push_back(i - 4);
      set<int> ret;
      for (__typeof((card).begin()) it = (card).begin(); it != (card).end();
           it++) {
        int sum = 0;
        for (int i = 0; i < (x.size()); ++i)
          if (x[i] == (*it) % 10) sum += x[i];
        for (int i = 0; i < (y.size()); ++i)
          if (y[i] == (*it) / 10) sum += y[i] * 10;
        ret.insert(sum);
      }
      int xx = x.size() + y.size();
      if (card.size() == ret.size()) ans = min(ans, xx);
    }
    cout << ans << endl;
  }
}
