#include <bits/stdc++.h>
using namespace std;
void rot1(string &s) {
  char c1 = s[0];
  for (int i = 0; i < (int)(3); i++) s[i] = s[i + 1];
  s[3] = c1;
}
void rot2(string &s) {
  char c1 = s[0];
  s[0] = s[4];
  s[4] = s[2];
  s[2] = s[5];
  s[5] = c1;
}
int main() {
  string str;
  while (cin >> str) {
    sort((str).begin(), (str).end());
    char base = str[0];
    set<string> used;
    int res = 0;
    do {
      if (used.count(str) == 0) {
        res++;
        queue<string> q;
        q.push(str);
        while (!q.empty()) {
          string n = q.front();
          q.pop();
          if (used.count(n) > 0) continue;
          used.insert(n);
          string a = n;
          rot1(a);
          string b = n;
          rot2(b);
          q.push(a);
          q.push(b);
        }
      }
    } while (next_permutation((str).begin(), (str).end()));
    cout << res << endl;
  }
  return 0;
}
