#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:100000000000000")
using namespace std;
const long double INF = -2e50;
map<string, int> use;
void dfs(string cur) {
  if (use.count(cur)) return;
  use[cur]++;
  string temp;
  temp = cur;
  temp[4] = cur[0];
  temp[1] = cur[4];
  temp[5] = cur[1];
  temp[0] = cur[5];
  dfs(temp);
  temp = cur;
  temp[4] = cur[2];
  temp[3] = cur[4];
  temp[5] = cur[3];
  temp[2] = cur[5];
  dfs(temp);
  temp = cur;
  temp[3] = cur[1];
  temp[0] = cur[3];
  temp[2] = cur[0];
  temp[1] = cur[2];
  dfs(temp);
}
int main() {
  string s;
  cin >> s;
  sort(s.begin(), s.end());
  int ans = 0;
  do {
    if (use.count(s)) continue;
    ans++;
    dfs(s);
  } while (next_permutation(s.begin(), s.end()));
  cout << ans;
}
