#include <bits/stdc++.h>
using namespace std;
long long n, i, j, ans = 0;
set<string> st;
vector<long long> v[24];
vector<long long> rotate(vector<long long> t) {
  vector<long long> k;
  k.push_back(t[0]), k.push_back(t[1]);
  k.push_back(t[5]), k.push_back(t[4]);
  k.push_back(t[2]), k.push_back(t[3]);
  return k;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string s;
  cin >> s;
  long long k = 1;
  v[0] = {0, 1, 2, 3, 4, 5};
  for (i = 1; i <= 3; i++) v[k] = rotate(v[k - 1]), k++;
  v[k] = {1, 0, 5, 4, 3, 2};
  k++;
  for (i = 1; i <= 3; i++) v[k] = rotate(v[k - 1]), k++;
  v[k] = {2, 3, 5, 4, 1, 0};
  k++;
  for (i = 1; i <= 3; i++) v[k] = rotate(v[k - 1]), k++;
  v[k] = {3, 2, 5, 4, 0, 1};
  k++;
  for (i = 1; i <= 3; i++) v[k] = rotate(v[k - 1]), k++;
  v[k] = {4, 5, 2, 3, 1, 0};
  k++;
  for (i = 1; i <= 3; i++) v[k] = rotate(v[k - 1]), k++;
  v[k] = {5, 4, 3, 2, 1, 0}, k++;
  for (i = 1; i <= 3; i++) v[k] = rotate(v[k - 1]), k++;
  sort(s.begin(), s.end());
  ans = 1;
  for (i = 0; i < 24; i++) {
    string aux;
    for (j = 0; j < 6; j++) aux.push_back(s[v[i][j]]);
    st.insert(aux);
  }
  while (next_permutation(s.begin(), s.end())) {
    if (st.find(s) == st.end()) {
      ans++;
      for (i = 0; i < 24; i++) {
        string aux;
        for (j = 0; j < 6; j++) aux.push_back(s[v[i][j]]);
        st.insert(aux);
      }
    }
  }
  cout << ans << endl;
}
