#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, s = 0, j, k, temp, x, count, res, tempres, tempcount;
  char str[3], ch;
  int arr[10];
  pair<char, int> p;
  map<pair<char, int>, int> data;
  map<pair<char, int>, int>::iterator it, it1;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%s", str);
    p.first = str[0];
    p.second = (int)(str[1] - '0');
    if (data.find(p) == data.end()) {
      data.insert(make_pair(p, 0));
      s++;
    }
  }
  res = s;
  j = 0;
  while (j < 1024) {
    k = 0;
    temp = j;
    count = 0;
    tempres = 0;
    for (it = data.begin(); it != data.end(); it++) {
      it->second = 0;
    }
    for (k = 0; k < 10; k++) {
      arr[k] = 0;
    }
    k = 0;
    while (temp) {
      arr[k] = temp & 1;
      tempres += arr[k];
      if (k < 5 && arr[k] == 1) {
        x = k + 1;
        for (it = data.begin(); it != data.end(); it++) {
          p = it->first;
          if (p.second == x) {
            it->second = it->second + 1;
          }
        }
      } else if (k >= 5 && arr[k] == 1) {
        switch (k) {
          case 5:
            ch = 'R';
            break;
          case 6:
            ch = 'G';
            break;
          case 7:
            ch = 'B';
            break;
          case 8:
            ch = 'Y';
            break;
          case 9:
            ch = 'W';
            break;
        }
        for (it = data.begin(); it != data.end(); it++) {
          p = it->first;
          if (p.first == ch) {
            it->second = it->second + 1;
          }
        }
      }
      k++;
      temp >>= 1;
    }
    for (it = data.begin(); it != data.end(); it++) {
      if (it->second == 2)
        count++;
      else if (it->second == 1) {
        p = it->first;
        tempcount = 0;
        if (arr[p.second - 1] == 1) {
          for (it1 = data.begin(); it1 != data.end(); it1++) {
            if ((it1->first).second == p.second && it1->second == 1) {
              tempcount++;
            }
          }
        } else {
          for (it1 = data.begin(); it1 != data.end(); it1++) {
            if ((it1->first).first == p.first && it1->second == 1) {
              tempcount++;
            }
          }
        }
        if (tempcount == 1) {
          it->second = 2;
          count++;
        }
      }
    }
    if (count >= s - 1) {
      res = min(res, tempres);
    }
    j++;
  }
  printf("%d\n", res);
  return 0;
}
