[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]:
create constant integer variable with name N = 150
declare integer arrays x, y and info with size N, and a variable n
integer function color_to_id with char argument ch
    if ch = 'R', return 1
    if ch is equal to 'G', return 2
    if ch = 'B', return 3
    if ch = 'Y', return 4
    if ch is equal to 'W', return 5
end of the block
function count_one with int argument x that returns int
    create integer variable called cnt with value 0
    while x
        change cnt to the sum of cnt and x & 1
        change x to x >> 1
    end of the block
    return cnt
end of the block
bool function check with int argument sta
    for i = 0 to n exclusive incrementing i
        change info[i] to 0
        set info[i] to info[i] | (1 << (x[i] - 1)) & sta
        change the value of info[i] to info[i] | (1 << (y[i] - 1 + 5)) & sta
        in a for loop, change j from 0 to i exclusive
            return false if info[i] = info[j] and (x[i] != x[j] or y[i] != y[j])
    end of the block
    return true
end of the block
define the main function
    declare string variable with name str
    read n and loop further
        for i = 0 to n exclusive incrementing i
            read input to str
            change the value of x[i] to color_to_id(str[0])
            set y[i] to str[1] - '0'
        end of the block
        define integer ans with value 10
        for integer i = 0 to 1 << 10 exclusive
            declare new integer variable n_one with value = result of count_one(i)
            if n_one >= ans, go to the start of the loop
            if check(i) returned true, set the value of 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;
}