#include <bits/stdc++.h>
using namespace std;
map<char, int> mm;
int n;
char s[210][4];
int vis[210][2];
int test(int x) {
  memset(vis, 0, sizeof(vis));
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < 2; j++) {
      if ((x >> (mm[s[i][j]] - 1)) & 1) {
        vis[i][j] = 1;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    if (vis[i][0] && vis[i][1]) continue;
    for (int j = i + 1; j <= n; j++) {
      if (vis[j][0] && vis[j][1]) continue;
      if (s[i][0] == s[j][0] && s[i][1] == s[j][1]) continue;
      if (!vis[i][0] && !vis[i][1] && !vis[j][0] && !vis[j][1]) return 0;
      if (!vis[i][0] && !vis[j][0] && s[i][1] == s[j][1]) return 0;
      if (!vis[i][1] && !vis[j][1] && s[i][0] == s[j][0]) return 0;
    }
  }
  return 1;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%s", s[i]);
  }
  mm['1'] = 1;
  mm['2'] = 2;
  mm['3'] = 3;
  mm['4'] = 4;
  mm['5'] = 5;
  mm['R'] = 6;
  mm['G'] = 7;
  mm['B'] = 8;
  mm['Y'] = 9;
  mm['W'] = 10;
  int ans = 1e9;
  for (int c = 0; c < (1 << 10); c++) {
    if (test(c)) {
      int tmp = 0;
      for (int i = 0; i < 10; i++) tmp += (c >> i) & 1;
      ans = min(ans, tmp);
    }
  }
  printf("%d\n", ans);
  return 0;
}
