#include <bits/stdc++.h>
using namespace std;
const double eps = 1E-9;
const double Exp = 2.718281828459045;
const double Pi = 3.1415926535897932;
const int Max_Bit = 63;
const int INF = 2000000000;
const long long LINF = 1000000000000000007ll;
const int MOD = 1000000007;
const int NMAX = 100005;
const int MMAX = 2005;
string s[105];
bool tool[12];
int ans[105];
int n;
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int getVal(char c) {
  if (c == 'R') return 1;
  if (c == 'G') return 2;
  if (c == 'B') return 3;
  if (c == 'Y') return 4;
  if (c == 'W') return 5;
}
bool judge(int t) {
  for (int i = 0; i < 10; ++i)
    if (t & (1 << i))
      tool[i] = 1;
    else
      tool[i] = 0;
  for (int i = 0; i < n; ++i) {
    ans[i] = 0;
    int t = getVal(s[i][0]);
    if (tool[t - 1]) ans[i] += t * 10;
    if (tool[5 + s[i][1] - '1']) ans[i] += 5 + s[i][1] - '1';
  }
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < n - i - 1; ++j) {
      if (s[i] != s[j + i + 1] && ans[i] == ans[j + i + 1]) return false;
    }
  return true;
}
int hehe(int t) {
  int ans = 0;
  for (int i = 0; i < 10; ++i)
    if (t & (1 << i)) ans++;
  return ans;
}
int main() {
  int res = 10;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) cin >> s[i];
  for (int i = 0; i < 1 << 10; ++i)
    if (judge(i)) {
      res = min(res, hehe(i));
    }
  printf("%d\n", res);
  return 0;
}
