#include <bits/stdc++.h>
using namespace std;
int a[11][11], b[11][11];
char x, y;
int n;
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x >> y;
    if (x == 'R')
      a[0][y - '0' - 1]++;
    else if (x == 'G')
      a[1][y - '0' - 1]++;
    else if (x == 'B')
      a[2][y - '0' - 1]++;
    else if (x == 'Y')
      a[3][y - '0' - 1]++;
    else if (x == 'W')
      a[4][y - '0' - 1]++;
  }
  int ans = 1111;
  for (int mask = 0; mask < (1 << 10); mask++) {
    int mi = 0;
    for (int i = 0; i < 10; i++)
      if (mask & (1 << i)) mi++;
    for (int i = 0; i < 5; i++)
      for (int j = 0; j < 5; j++) {
        b[i][j] = a[i][j];
        if ((mask & (1 << i)) && (mask & (1 << (j + 5)))) b[i][j] = 0;
      }
    int maxkol = 25;
    while (maxkol--) {
      for (int i = 0; i < 5; i++)
        if (mask & (1 << i)) {
          int know = 0;
          for (int j = 0; j < 5; j++)
            if (b[i][j]) know++;
          if (know == 1) {
            for (int j = 0; j < 5; j++)
              if (b[i][j]) b[i][j] = 0;
          }
        }
      for (int j = 0; j < 5; j++)
        if (mask & (1 << (j + 5))) {
          int know = 0;
          for (int i = 0; i < 5; i++)
            if (b[i][j]) know++;
          if (know == 1) {
            for (int i = 0; i < 5; i++)
              if (b[i][j]) b[i][j] = 0;
          }
        }
    }
    int kol = 0;
    for (int i = 0; i < 5; i++)
      for (int j = 0; j < 5; j++)
        if (b[i][j]) kol++;
    if (kol < 2) ans = min(mi, ans);
  }
  cout << ans << "\n";
  cin >> n;
  return 0;
}
