#include <bits/stdc++.h>
using namespace std;
string s;
int w(int a) {
  int val = 0;
  for (int i = 1; i < 32; i *= 2)
    if (i & a) val++;
  return val;
}
bool m[5][5];
int main() {
  int n;
  cin >> n;
  set<string> kortit;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    int x, y;
    if (s[0] == 'R') x = 0;
    if (s[0] == 'G') x = 1;
    if (s[0] == 'B') x = 2;
    if (s[0] == 'Y') x = 3;
    if (s[0] == 'W') x = 4;
    y = s[1] - '1';
    m[x][y] = 1;
  }
  int v = 10000;
  for (int mask1 = 0; mask1 < 32; mask1++)
    for (int mask2 = 0; mask2 < 32; mask2++) {
      bool kay = 1;
      bool litistys[5] = {0, 0, 0, 0, 0};
      for (int i = 0; i < 5; i++) {
        bool qsi = 0;
        bool onjo = 0;
        for (int e = 0; e < 5; e++) {
          if (!(mask1 & (1 << e))) {
            if (m[i][e]) {
              if (onjo) {
                qsi = 1;
              } else {
                onjo = 1;
                litistys[i] = 1;
              }
            }
          }
        }
        if (qsi) kay = 0;
      }
      int missaus = 0;
      for (int i = 0; i < 5; i++)
        if (litistys[i])
          if (!(mask2 & (1 << i))) missaus++;
      if (missaus > 1) kay = 0;
      for (int e = 0; e < 5; e++)
        if (mask1 & (1 << e)) {
          int missaus = 0;
          for (int i = 0; i < 5; i++)
            if (m[i][e])
              if (!(mask2 & (1 << i))) missaus++;
          if (missaus > 1) kay = 0;
        }
      if (kay) v = min(v, w(mask1) + w(mask2));
    }
  cout << v << endl;
  return 0;
}
