#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
const int MAXN = 0;
const int MAXK = 0;
vector<string> rotation(string str) {
  int n = str.length();
  vector<string> ans;
  for (int i = 0; i < (n); ++i) ans.push_back(str.substr(i) + str.substr(0, i));
  return ans;
}
int rot[3][4] = {{0, 2, 1, 3}, {0, 4, 1, 5}, {2, 4, 3, 5}};
string oneRotate(string str, int axis, int times) {
  string tmp = "";
  for (int x : rot[axis]) tmp += str[x];
  int idx = 0;
  string rotated = tmp.substr(times) + tmp.substr(0, times);
  for (int x : rot[axis]) str[x] = rotated[idx++];
  return str;
}
string rotate(string str, int i, int j, int k) {
  str = oneRotate(str, 0, i);
  str = oneRotate(str, 1, j);
  str = oneRotate(str, 2, k);
  return str;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  string str;
  cin >> str;
  sort(str.begin(), str.end());
  int ans = 0;
  set<string> s;
  do {
    bool flag = true;
    vector<string> v;
    for (int i = 0; i < (4); ++i)
      for (int j = 0; j < (4); ++j)
        for (int k = 0; k < (4); ++k) {
          string cur = rotate(str, i, j, k);
          if (s.find(cur) != s.end()) flag = false;
          v.push_back(cur);
        }
    for (auto foo : v) s.insert(foo);
    ans += flag;
  } while (next_permutation(str.begin(), str.end()));
  cout << ans << '\n';
  return 0;
}
