[TASK]:
You will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.

[INSTRUCTION]:
The following libraries are already included in the code.
```cpp
#include <cstdio>
#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <cstring>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <fstream>
#include <climits>
#include <cassert>
#include <iomanip>
#include <sstream>
#include <bitset>
using namespace std;
```
Do not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.

[PSEUDOCODE]:
N = const int = 150
let x[N], y[N], info[N], n be ints
in int function color_to_id taking char ch
    if ch = 'R' then return 1
    if ch = 'G' then return 2
    if ch = 'B' then return 3
    if ch = 'Y' then return 4
    if ch = 'W' then return 5
end of the block
in int function count_one taking x
    cnt = 0 = int
    while x isn't 0
        increment cnt by x&1
        x = x bit right shift 1
    end of the block
    return cnt
end of the block
in bool function check taking sta = int
    for i = 0 to n exclusive
        set info[i] = 0
        info[i] bitwise or (1 bitwise left shift (x[i] - 1)) bitwise and sta
        info[i] bitwise or (1 bitwise left shift (y[i] - 1 + 5)) bitwise and sta
        for j = 0 to i exclusive
            if info[i] = info[j] and (x[i] is not x[j] or y[i] is not y[j])
    end of the block
    return true
end of the block
define the main function
    str = string
    while reading n
        for i = 0 to n exclusive
            read str
            set x[i] = color_to_id of str[0]
            y[i] = str[1] - '0'
        end of the block
        ans = 10 = int
        for i = 0 to 1 bitwise left shit 10
            n_one = count_one(i) = int
            if n_one >= ans then go to next iteration
            if check(i) then set ans to n_one
        end of the block
        print ans
    end of the block
    return to indicate successful execution
end of the block

[CODE]:

const int N = 150;
int x[N], y[N], info[N], n;
int color_to_id(char ch) {
    if (ch == 'R') return 1;
    if (ch == 'G') return 2;
    if (ch == 'B') return 3;
    if (ch == 'Y') return 4;
    if (ch == 'W') return 5;
}
int count_one(int x) {
    int cnt = 0;
    while (x) {
        cnt += (x & 1);
        x >>= 1;
    }
    return cnt;
}
bool check(int sta) {
    for (int i = 0; i < n; i++) {
        info[i] = 0;
        info[i] |= (1 << (x[i] - 1)) & sta;
        info[i] |= (1 << (y[i] - 1 + 5)) & sta;
        for (int j = 0; j < i; j++)
            if (info[i] == info[j] && (x[i] != x[j] || y[i] != y[j])) return false;
    }
    return true;
}
int main() {
    string str;
    while (cin >> n) {
        for (int i = 0; i < n; i++) {
            cin >> str;
            x[i] = color_to_id(str[0]);
            y[i] = str[1] - '0';
        }
        int ans = 10;
        for (int i = 0; i < (1 << 10); i++) {
            int n_one = count_one(i);
            if (n_one >= ans) continue;
            if (check(i)) ans = n_one;
        }
        cout << ans << endl;
    }
    return 0;
}