#include <bits/stdc++.h>
using namespace std;
string S;
set<string> answer;
void izomorphism1(string &s) {
  swap(s[0], s[3]);
  swap(s[1], s[3]);
  swap(s[2], s[3]);
}
void izomorphism2(string &s) {
  swap(s[1], s[4]);
  swap(s[3], s[5]);
  swap(s[4], s[5]);
}
void izomorphism3(string &s) {
  swap(s[4], s[2]);
  swap(s[0], s[5]);
  swap(s[4], s[5]);
}
int main() {
  cin >> S;
  sort(S.begin(), S.end());
  do {
    string cur_S, min_string;
    cur_S = S;
    min_string = S;
    for (int i = 1; i <= 4; i++, izomorphism1(cur_S))
      for (int j = 1; j <= 4; j++, izomorphism2(cur_S))
        for (int z = 1; z <= 4; z++, izomorphism3(cur_S)) {
          min_string = min(min_string, cur_S);
        }
    answer.insert(min_string);
  } while (next_permutation(S.begin(), S.end()));
  cout << answer.size() << endl;
  return 0;
}
