#include <bits/stdc++.h>
using namespace std;
map<string, int> flag;
void bfs(string str2) {
  flag[str2] = 1;
  queue<string> Q;
  Q.push(str2);
  char t, b, l, r, ff, rr;
  while (!Q.empty()) {
    string u = Q.front();
    Q.pop();
    string v = u;
    t = u[4];
    rr = u[0];
    b = u[5];
    ff = u[1];
    l = u[2];
    r = u[3];
    v[0] = t, v[1] = b, v[2] = l, v[3] = r, v[4] = ff, v[5] = rr;
    if (flag[v] == 0) flag[v] = 1, Q.push(v);
    l = u[5], rr = u[3], r = u[4], ff = u[2];
    t = u[0], b = u[1];
    v[0] = t, v[1] = b, v[2] = l, v[3] = r, v[4] = ff, v[5] = rr;
    if (flag[v] == 0) flag[v] = 1, Q.push(v);
    l = u[0], t = u[3], r = u[1], b = u[2], ff = u[4], rr = u[5];
    v[0] = t, v[1] = b, v[2] = l, v[3] = r, v[4] = ff, v[5] = rr;
    if (flag[v] == 0) flag[v] = 1, Q.push(v);
  }
}
int main() {
  string str1;
  cin >> str1;
  sort(str1.begin(), str1.end());
  int ans = 0;
  do {
    if (flag[str1] == 0) {
      bfs(str1);
      ans++;
    }
  } while (next_permutation(str1.begin(), str1.end()));
  printf("%d\n", ans);
  return 0;
}
