#include <bits/stdc++.h>
using namespace std;
int perm[6][6] = {{0, 1, 2, 3, 4, 5}, {1, 5, 2, 0, 4, 3}, {2, 1, 5, 3, 0, 4},
                  {3, 0, 2, 5, 4, 1}, {4, 1, 0, 3, 5, 2}, {5, 1, 4, 3, 2, 0}};
int n;
vector<int> v;
map<string, int> exist;
vector<string> combs, gens;
set<string> found;
void gen(string s, string cur) {
  if (s == "")
    gens.push_back(cur);
  else {
    for (int i = 0; i < s.size(); i++) {
      string ns = s;
      ns.erase(i, 1);
      gen(ns, cur + string(1, s[i]));
    }
  }
}
void cover(int ip, string s) {
  if (ip < 6) {
    string cur = "";
    for (int i = 0; i < 6; i++) cur += string(1, s[perm[ip][i]]);
    for (int i = 0; i < 4; i++) {
      found.insert(cur);
      char tmp = cur[1];
      for (int k = 1; k < 4; k++) cur[k] = cur[k + 1];
      cur[4] = tmp;
    }
    cover(ip + 1, s);
  }
}
int main() {
  string s;
  cin >> s;
  gen(s, "");
  sort(gens.begin(), gens.end());
  gens.resize(unique(gens.begin(), gens.end()) - gens.begin());
  int ret = 0;
  for (int i = 0; i < gens.size(); i++)
    if (found.find(gens[i]) == found.end()) {
      cover(0, gens[i]);
      ret++;
    }
  cout << ret << endl;
  return 0;
}
