#include <bits/stdc++.h>
#pragma comment(linker, "/stack:64000000")
using namespace std;
int d[3][4] = {{0, 1, 4, 5}, {0, 2, 4, 3}, {1, 2, 5, 3}};
set<string> used;
string rot(string s, int k) {
  string r = s;
  for (int(i) = 0; (i) < (4); (i)++) {
    r[d[k][i]] = s[d[k][(i + 1) % 4]];
  }
  return r;
}
void dfs(string s) {
  used.insert(s);
  for (int(i) = 0; (i) < (3); (i)++) {
    string t = rot(s, i);
    if (!used.count(t)) {
      dfs(t);
    }
  }
}
int main() {
  string s;
  cin >> s;
  sort((s).begin(), (s).end());
  int res = 0;
  do {
    if (!used.count(s)) {
      ++res;
      dfs(s);
    }
  } while (next_permutation((s).begin(), (s).end()));
  cout << res;
  return 0;
}
