#include <bits/stdc++.h>
int n;
std::pair<char, char> p;
std::vector<std::pair<char, int> > karte;
char temp2[2];
bool x[10];
bool y[10];
int r = 10000;
bool matrix[6][6];
bool matrix2[6][6];
int prolazix[7];
int prolaziy[7];
int main() {
  scanf("%d", &n);
  karte.resize(n + 1);
  for (int i = 0; i < n; ++i) {
    scanf("%s", temp2);
    karte[i].first = temp2[0];
    karte[i].second = temp2[1];
  }
  for (int i = 0; i < n; ++i) {
    if (karte[i].first == 'B')
      karte[i].first = '1';
    else if (karte[i].first == 'G')
      karte[i].first = '2';
    else if (karte[i].first == 'R')
      karte[i].first = '3';
    else if (karte[i].first == 'W')
      karte[i].first = '4';
    else if (karte[i].first == 'Y')
      karte[i].first = '5';
  }
  for (int i = 0; i < n; ++i) {
    matrix[karte[i].first - '1'][karte[i].second - '1'] = true;
  }
  for (int i = 0; i < (1 << 5); ++i)
    for (int j = 0; j < (1 << 5); ++j) {
      int neprolazi = 0;
      memset(prolazix, 0, sizeof(prolazix));
      memset(prolaziy, 0, sizeof(prolaziy));
      for (int l = 0; l < 5; ++l)
        for (int k = 0; k < 5; ++k) matrix2[l][k] = matrix[l][k];
      memset(x, false, sizeof(x));
      memset(y, false, sizeof(y));
      for (int k = 0; k < 5; ++k) {
        if ((1 << k) & i) x[k] = true;
      }
      for (int k = 0; k < 5; ++k) {
        if ((1 << k) & j) y[k] = true;
      }
      for (int l = 0; l < 5; ++l)
        for (int k = 0; k < 5; ++k) {
          if (x[l] && y[k]) {
            matrix2[l][k] = false;
            continue;
          }
        }
      for (int l = 0; l < 5; ++l)
        for (int k = 0; k < 5; ++k) {
          if (!matrix2[l][k]) continue;
          if (x[l])
            ++prolazix[l];
          else if (y[k])
            ++prolaziy[k];
          else
            ++neprolazi;
        }
      bool ne = false;
      for (int k = 0; k < 5; ++k) {
        if (prolazix[k] < 2 && prolaziy[k] < 2) continue;
        ne = true;
      }
      if (neprolazi > 1) ne = true;
      if (ne) continue;
      int temp = 0;
      for (int i = 0; i < 5; ++i) {
        if (x[i]) ++temp;
        if (y[i]) ++temp;
      }
      r = std::min(r, temp);
    }
  printf("%d\n", r);
}
