#include <bits/stdc++.h>
using namespace std;
using LL = long long;
constexpr int N = 1e5 + 5;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
string foo(string x) {
  tie(x[0], x[1], x[2], x[3]) = make_tuple(x[1], x[2], x[3], x[0]);
  return x;
}
string bar(string x) {
  tie(x[4], x[0], x[5], x[2]) = make_tuple(x[0], x[5], x[2], x[4]);
  return x;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  string s;
  cin >> s;
  set<string> st;
  sort(begin(s), end(s));
  do {
    string mn = s;
    string t = s;
    for (int i = 0; i < 1000; i++) {
      if (rng() % 2)
        t = foo(t);
      else
        t = bar(t);
      mn = min(mn, t);
    }
    st.insert(mn);
  } while (next_permutation(begin(s), end(s)));
  cout << st.size();
}
