#include <bits/stdc++.h>
using namespace std;
set<string> vis;
void dfs(string s) {
  if (vis.count(s)) {
    return;
  }
  vis.insert(s);
  string s1 = "";
  s1 += s[1];
  s1 += s[2];
  s1 += s[3];
  s1 += s[0];
  s1 += s[4];
  s1 += s[5];
  dfs(s1);
  string s2 = "";
  s2 += s[0];
  s2 += s[4];
  s2 += s[2];
  s2 += s[5];
  s2 += s[3];
  s2 += s[1];
  dfs(s2);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  string s;
  cin >> s;
  sort(s.begin(), s.end());
  int ans = 0;
  do {
    if (vis.find(s) != vis.end()) {
      continue;
    }
    ans++;
    dfs(s);
  } while (next_permutation(s.begin(), s.end()));
  cout << ans << '\n';
}
