#include <bits/stdc++.h>
using namespace std;
set<string> vis;
int rRight[6] = {4, 1, 2, 5, 3, 0};
int rDown[6] = {1, 3, 0, 2, 4, 5};
string rotateRight(string x) {
  string res = "";
  for (int i = 0; i < 6; i++) {
    res += x[rRight[i]];
  }
  return res;
}
string rotateDown(string x) {
  string res = "";
  for (int i = 0; i < 6; i++) {
    res += x[rDown[i]];
  }
  return res;
}
void dfs(string x) {
  if (vis.count(x)) return;
  vis.insert(x);
  dfs(rotateRight(x));
  dfs(rotateDown(x));
}
int main() {
  string s;
  cin >> s;
  sort(s.begin(), s.end());
  int ans = 0;
  do {
    if (vis.count(s)) continue;
    ans++;
    dfs(s);
  } while (next_permutation(s.begin(), s.end()));
  cout << ans << endl;
}
