[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]:
x,res=int
t=map from string to bool
s,r=string
define the main function
    read s
    sort s
    do
        if not t[s]
            increment res
            r=s[0]
            append s[1] to r
            append s[2] to r
            append s[3] to r
            append s[4] to r
            append s[5] to r
            t[r]=true
            r=s[0]
            append s[2] to r
            append s[3] to r
            append s[4] to r
            append s[1] to r
            append s[5] to r
            t[r]=true
            r=s[0]
            append s[3] to r
            append s[4] to r
            append s[1] to r
            append s[2] to r
            append s[5] to r
            t[r]=true
            r=s[0]
            append s[4] to r
            append s[1] to r
            append s[2] to r
            append s[3] to r
            append s[5] to r
            t[r]=true
            r=s[5]
            append s[4] to r
            append s[3] to r
            append s[2] to r
            append s[1] to r
            append s[0] to r
            t[r]=true
            r=s[5]
            append s[1] to r
            append s[4] to r
            append s[3] to r
            append s[2] to r
            append s[0] to r
            t[r]=true
            r=s[5]
            append s[2] to r
            append s[1] to r
            append s[4] to r
            append s[3] to r
            append s[0] to r
            t[r]=true
            r=s[5]
            append s[3] to r
            append s[2] to r
            append s[1] to r
            append s[4] to r
            append s[0] to r
            t[r]=true
            r=s[1]
            append s[5] to r
            append s[2] to r
            append s[0] to r
            append s[4] to r
            append s[3] to r
            t[r]=true
            r=s[1]
            append s[2] to r
            append s[0] to r
            append s[4] to r
            append s[5] to r
            append s[3] to r
            t[r]=true
            r=s[1]
            append s[0] to r
            append s[4] to r
            append s[5] to r
            append s[2] to r
            append s[3] to r
            t[r]=true
            r=s[1]
            append s[4] to r
            append s[5] to r
            append s[2] to r
            append s[0] to r
            append s[3] to r
            t[r]=true
            r=s[3]
            append s[4] to r
            append s[0] to r
            append s[2] to r
            append s[5] to r
            append s[1] to r
            t[r]=true
            r=s[3]
            append s[5] to r
            append s[4] to r
            append s[0] to r
            append s[2] to r
            append s[1] to r
            t[r]=true
            r=s[3]
            append s[2] to r
            append s[5] to r
            append s[4] to r
            append s[0] to r
            append s[1] to r
            t[r]=true
            r=s[3]
            append s[0] to r
            append s[2] to r
            append s[5] to r
            append s[4] to r
            append s[1] to r
            t[r]=true
            r=s[2]
            append s[3] to r
            append s[0] to r
            append s[1] to r
            append s[5] to r
            append s[4] to r
            t[r]=true
            r=s[2]
            append s[5] to r
            append s[3] to r
            append s[0] to r
            append s[1] to r
            append s[4] to r
            t[r]=true
            r=s[2]
            append s[1] to r
            append s[5] to r
            append s[3] to r
            append s[0] to r
            append s[4] to r
            t[r]=true
            r=s[2]
            append s[0] to r
            append s[1] to r
            append s[5] to r
            append s[3] to r
            append s[4] to r
            t[r]=true
            r=s[4]
            append s[5] to r
            append s[1] to r
            append s[0] to r
            append s[3] to r
            append s[2] to r
            t[r]=true
            r=s[4]
            append s[3] to r
            append s[5] to r
            append s[1] to r
            append s[0] to r
            append s[2] to r
            t[r]=true
            r=s[4]
            append s[0] to r
            append s[3] to r
            append s[5] to r
            append s[1] to r
            append s[2] to r
            t[r]=true
            r=s[4]
            append s[1] to r
            append s[0] to r
            append s[3] to r
            append s[5] to r
            append s[2] to r
            t[r]=true
        end of the block
    while next permutation of s
    print res
    return to indicate successful execution
end of the block

[CODE]:

int x, res;
map<string, bool> t;
string s, r;
int main() {
    cin >> s;
    sort(s.begin(), s.end());
    do {
        if (!t[s]) {
            res++;
            r = s[0];
            r += s[1];
            r += s[2];
            r += s[3];
            r += s[4];
            r += s[5];
            t[r] = true;
            r = s[0];
            r += s[2];
            r += s[3];
            r += s[4];
            r += s[1];
            r += s[5];
            t[r] = true;
            r = s[0];
            r += s[3];
            r += s[4];
            r += s[1];
            r += s[2];
            r += s[5];
            t[r] = true;
            r = s[0];
            r += s[4];
            r += s[1];
            r += s[2];
            r += s[3];
            r += s[5];
            t[r] = true;
            r = s[5];
            r += s[4];
            r += s[3];
            r += s[2];
            r += s[1];
            r += s[0];
            t[r] = true;
            r = s[5];
            r += s[1];
            r += s[4];
            r += s[3];
            r += s[2];
            r += s[0];
            t[r] = true;
            r = s[5];
            r += s[2];
            r += s[1];
            r += s[4];
            r += s[3];
            r += s[0];
            t[r] = true;
            r = s[5];
            r += s[3];
            r += s[2];
            r += s[1];
            r += s[4];
            r += s[0];
            t[r] = true;
            r = s[1];
            r += s[5];
            r += s[2];
            r += s[0];
            r += s[4];
            r += s[3];
            t[r] = true;
            r = s[1];
            r += s[2];
            r += s[0];
            r += s[4];
            r += s[5];
            r += s[3];
            t[r] = true;
            r = s[1];
            r += s[0];
            r += s[4];
            r += s[5];
            r += s[2];
            r += s[3];
            t[r] = true;
            r = s[1];
            r += s[4];
            r += s[5];
            r += s[2];
            r += s[0];
            r += s[3];
            t[r] = true;
            r = s[3];
            r += s[4];
            r += s[0];
            r += s[2];
            r += s[5];
            r += s[1];
            t[r] = true;
            r = s[3];
            r += s[5];
            r += s[4];
            r += s[0];
            r += s[2];
            r += s[1];
            t[r] = true;
            r = s[3];
            r += s[2];
            r += s[5];
            r += s[4];
            r += s[0];
            r += s[1];
            t[r] = true;
            r = s[3];
            r += s[0];
            r += s[2];
            r += s[5];
            r += s[4];
            r += s[1];
            t[r] = true;
            r = s[2];
            r += s[3];
            r += s[0];
            r += s[1];
            r += s[5];
            r += s[4];
            t[r] = true;
            r = s[2];
            r += s[5];
            r += s[3];
            r += s[0];
            r += s[1];
            r += s[4];
            t[r] = true;
            r = s[2];
            r += s[1];
            r += s[5];
            r += s[3];
            r += s[0];
            r += s[4];
            t[r] = true;
            r = s[2];
            r += s[0];
            r += s[1];
            r += s[5];
            r += s[3];
            r += s[4];
            t[r] = true;
            r = s[4];
            r += s[5];
            r += s[1];
            r += s[0];
            r += s[3];
            r += s[2];
            t[r] = true;
            r = s[4];
            r += s[3];
            r += s[5];
            r += s[1];
            r += s[0];
            r += s[2];
            t[r] = true;
            r = s[4];
            r += s[0];
            r += s[3];
            r += s[5];
            r += s[1];
            r += s[2];
            t[r] = true;
            r = s[4];
            r += s[1];
            r += s[0];
            r += s[3];
            r += s[5];
            r += s[2];
            t[r] = true;
        }
    } while (next_permutation(s.begin(), s.end()));
    cout << res << endl;
    return 0;
}