#include <bits/stdc++.h>
using namespace std;
template <class t>
ostream &operator<<(ostream &tout, const vector<t> &s) {
  tout << '[';
  for (int i = 0; i < s.size(); i++)
    if (i + 1 == s.size())
      tout << s[i];
    else
      tout << s[i] << ',';
  tout << ']';
  return (tout);
}
template <class a, class b>
ostream &operator<<(ostream &tout, const pair<a, b> &c) {
  return (tout << '(' << c.first << ',' << c.second << ')');
}
vector<vector<int> > all;
void rl(vector<int> &s) {
  for (int i = 1; i <= 3; i++) swap(s[i], s[i + 1]);
}
void rl(vector<int> &s, int k) {
  for (int i = 1; i <= k; i++) rl(s);
}
void rr(vector<int> &s) {
  swap(s[0], s[2]);
  swap(s[2], s[5]);
  swap(s[5], s[4]);
}
void rr(vector<int> &s, int k) {
  for (int i = 1; i <= k; i++) rr(s);
}
int main() {
  vector<int> mai;
  for (int i = 0; i < 6; i++) mai.push_back(i);
  for (int i = 0; i < 4; i++)
    for (int j = 0; j < 4; j++)
      for (int k = 0; k < 4; k++)
        for (int l = 0; l < 4; l++) {
          vector<int> temp = mai;
          rl(mai, i);
          rr(mai, j);
          rl(mai, k);
          rr(mai, l);
          all.push_back(mai);
        }
  sort(all.begin(), all.end());
  all.resize(unique(all.begin(), all.end()) - all.begin());
  string st;
  cin >> st;
  sort(st.begin(), st.end());
  int ans = 0;
  set<string> Set;
  do {
    if (Set.find(st) != Set.end()) continue;
    ans++;
    for (int i = 0; i < all.size(); i++) {
      string p(6, '0');
      for (int j = 0; j < all[i].size(); j++) p[all[i][j]] = st[j];
      Set.insert(p);
    }
  } while (next_permutation(st.begin(), st.end()));
  cout << ans << endl;
}
