#include <bits/stdc++.h>
using namespace std;
set<string> st;
void dfs(char *s) {
  if (st.count(s)) return;
  st.insert(s);
  char a[] = {s[3], s[0], s[1], s[2], s[4], s[5], 0};
  dfs(a);
  char b[] = {s[1], s[2], s[3], s[0], s[4], s[5], 0};
  dfs(b);
  char c[] = {s[2], s[3], s[0], s[1], s[4], s[5], 0};
  dfs(c);
  char d[] = {s[5], s[1], s[4], s[3], s[0], s[2], 0};
  dfs(d);
  char e[] = {s[4], s[1], s[5], s[3], s[2], s[0], 0};
  dfs(e);
}
int main() {
  char c[10];
  scanf("%s", c);
  sort(c, c + 6);
  int ans = 0;
  do {
    if (st.count(c)) continue;
    ans++;
    dfs(c);
  } while (next_permutation(c, c + 6));
  printf("%d\n", ans);
  return 0;
}
