#include <bits/stdc++.h>
using namespace std;
int ans = 0;
string s;
set<string> q;
void dfs(string s1) {
  if (q.find(s1) != q.end()) return;
  q.insert(s1);
  char s2[] = {s1[1], s1[2], s1[3], s1[0], s1[4], s1[5], 0};
  dfs(s2);
  char s3[] = {s1[5], s1[1], s1[4], s1[3], s1[0], s1[2], 0};
  dfs(s3);
}
int main() {
  cin >> s;
  sort(s.begin(), s.end());
  do {
    if (q.find(s) != q.end()) continue;
    ans++;
    dfs(s);
  } while (next_permutation(s.begin(), s.end()));
  cout << ans << endl;
  return 0;
}
