#include <bits/stdc++.h>
#pragma warning(disable : 4786)
using namespace std;
set<string> S;
void dfs(string s) {
  if (S.find(s) != S.end()) return;
  S.insert(s);
  char s1[] = {s[1], s[2], s[3], s[0], s[4], s[5], 0};
  dfs(s1);
  char s2[] = {s[0], s[4], s[2], s[5], s[3], s[1], 0};
  dfs(s2);
}
int main() {
  int ans = 0;
  char s[10];
  cin >> s;
  sort(s, s + 6);
  do {
    if (S.find(s) != S.end()) continue;
    ans++;
    dfs(s);
  } while (next_permutation(s, s + 6));
  printf("%d\n", ans);
  return 0;
}
