#include <bits/stdc++.h>
using namespace std;
struct TCard {
  char col;
  char num;
} c[100], d[100];
int i, j, k, n, p, q;
char t[3], w[11] = "RGBYW12345";
bool flag;
bool card_cmp(TCard x, TCard y) {
  return (x.col < y.col) || (x.col == y.col && x.num < y.num);
}
int num_pos(int x) {
  int i, p;
  for (i = 0x1, p = 0; i <= 0x400; i <<= 1)
    if ((x & i) != 0) ++p;
  return p;
}
int main() {
  cin >> n;
  for (i = 0; i < n; ++i) {
    cin >> t;
    c[i].col = t[0];
    c[i].num = t[1];
  }
  for (i = 0x0, p = 8; i <= 0x400; ++i) {
    q = num_pos(i);
    if (q < p) {
      for (j = 0; j < n; ++j) d[j].col = d[j].num = '?';
      for (k = 0; k < 10; ++k)
        if ((i & (1 << k)) != 0)
          for (j = 0; j < n; ++j) {
            if (c[j].col == w[k])
              d[j].col = w[k];
            else if (c[j].num == w[k])
              d[j].num = w[k];
          }
      flag = true;
      for (k = 0; k < n; ++k)
        for (j = 0; j < k; ++j)
          if (!(c[k].col == c[j].col && c[k].num == c[j].num) &&
              (d[k].col == d[j].col && d[k].num == d[j].num))
            flag = false;
      if (flag) p = q;
    }
  }
  cout << p;
}
