#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int MAX = 5e5 + 5;
int a[MAX][2], f[10];
int get(char ch) {
  if (ch == 'R') return 0;
  if (ch == 'G') return 1;
  if (ch == 'B') return 2;
  if (ch == 'Y') return 3;
  if (ch == 'W') return 4;
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    a[i][0] = get(s[0]);
    a[i][1] = s[1] - '1' + 5;
  }
  int ans = 1e9;
  for (int i = 0; i < (1 << 10); i++) {
    int flag = 0, cnt = 0;
    memset(f, 0, sizeof f);
    for (int j = 0; j < 10; j++) {
      if (i & (1 << j)) {
        f[j] = 1;
        cnt++;
      }
    }
    for (int j = 0; j < n; j++) {
      for (int k = j + 1; k < n; k++) {
        int a1 = a[j][0];
        int a2 = a[j][1];
        int b1 = a[k][0];
        int b2 = a[k][1];
        if (a1 == b1 && a2 == b2) continue;
        if (a1 == b1) {
          if (!f[a2] && !f[b2]) {
            flag = 1;
            break;
          }
        }
        if (a2 == b2) {
          if (!f[a1] && !f[b1]) {
            flag = 1;
            break;
          }
        }
        if (!f[a1] && !f[a2] && !f[b1] && !f[b2]) {
          flag = 1;
          break;
        }
      }
      if (flag) break;
    }
    if (!flag) ans = min(ans, cnt);
  }
  cout << ans;
}
