[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]:
declare new constant integer MAX_N with value 1000 + 10
declare 3d array of integers a with size MAX_N by 2 by 2, and b with size 4 by 2 by 2
check is a new array of booleans with MAX_N elements
boolean function hast with int arguments i and s
    change the value of b[0][0][0] to a[i][0][0]
    assign a[i][0][1] to b[0][0][1]
    change b[0][1][0] to a[i][1][0]
    set the value of b[0][1][1] to a[i][1][1]
    set the value of b[1][0][0] to a[i][1][0]
    assign the new value = a[i][0][0] to b[1][0][1]
    assign the new value = a[i][1][1] to b[1][1][0]
    change the value of b[1][1][1] to a[i][0][1]
    change b[2][0][0] to a[i][1][1]
    set b[2][0][1] to a[i][1][0]
    change the value of b[2][1][0] to a[i][0][1]
    change the value of b[2][1][1] to a[i][0][0]
    change b[3][0][0] to a[i][0][1]
    change the value of b[3][0][1] to a[i][1][1]
    assign the new value = a[i][0][0] to b[3][1][0]
    set b[3][1][1] to a[i][1][0]
    start for loop from i = 0 to 4 exclusive
        declare integer variable x with value 0
        start for loop from j = 0 to 2 exclusive incrementing j
            start for loop from t = 0 to 2 exclusive
                increment x if b[i][j][t] = a[s][j][t]
        if x is equal to 4, return true
    end of the block
    return false
end of the block
define the main function
    define integers n, aa, bb and ans where ans = 0
    create new string called s
    read variable n from the input
    for i from 0 to n exclusive
        read standard input to aa and bb
        if i is less than n - 1, read s
        set a[i][0][0] to aa / 10
        assign aa modulo 10 to a[i][0][1]
        set the value of a[i][1][0] to bb / 10
        set the value of a[i][1][1] to bb modulo 10
    end of the block
    start for loop from i = 0 to n exclusive incrementing i
        if check[i] is true, skip the rest of the loop
        in a for loop, change j from i+1 to n exclusive
            if hast(i, j) returned true, change the value of check[j] to true
    end of the block
    for i from 0 to n exclusive
        if check[i] is false, increment ans
    print ans
    return to indicate successful execution
end of the block

[CODE]:

const int MAX_N = 1000 + 10;
int a[MAX_N][2][2], b[4][2][2];
bool check[MAX_N];
bool hast(int i, int s) {
    b[0][0][0] = a[i][0][0];
    b[0][0][1] = a[i][0][1];
    b[0][1][0] = a[i][1][0];
    b[0][1][1] = a[i][1][1];
    b[1][0][0] = a[i][1][0];
    b[1][0][1] = a[i][0][0];
    b[1][1][0] = a[i][1][1];
    b[1][1][1] = a[i][0][1];
    b[2][0][0] = a[i][1][1];
    b[2][0][1] = a[i][1][0];
    b[2][1][0] = a[i][0][1];
    b[2][1][1] = a[i][0][0];
    b[3][0][0] = a[i][0][1];
    b[3][0][1] = a[i][1][1];
    b[3][1][0] = a[i][0][0];
    b[3][1][1] = a[i][1][0];
    for (int i = 0; i < 4; i++) {
        int x = 0;
        for (int j = 0; j < 2; j++)
            for (int t = 0; t < 2; t++)
                if (b[i][j][t] == a[s][j][t]) x++;
        if (x == 4) return true;
    }
    return false;
}
int main() {
    int n, aa, bb, ans = 0;
    string s;
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> aa >> bb;
        if (i < n - 1) cin >> s;
        a[i][0][0] = aa / 10;
        a[i][0][1] = aa % 10;
        a[i][1][0] = bb / 10;
        a[i][1][1] = bb % 10;
    }
    for (int i = 0; i < n; i++) {
        if (check[i] == true) continue;
        for (int j = i + 1; j < n; j++)
            if (hast(i, j) == true) check[j] = true;
    }
    for (int i = 0; i < n; i++)
        if (check[i] == false) ans++;
    cout << ans << endl;
    return 0;
}