#include <bits/stdc++.h>
using namespace std;
string rot[6] = {"012345", "215304", "152043", "410352", "514320", "325401"};
vector<string> rotate(string ss) {
  char s[7];
  char t[7];
  for (int k = (0); k < (int)(6); k++) s[k] = ss[k];
  s[6] = 0;
  t[6] = 0;
  vector<string> res;
  for (int i = (0); i < (int)(6); i++) {
    for (int j = (0); j < (int)(6); j++) {
      t[j] = s[rot[i][j] - '0'];
    }
    for (int iter = (0); iter < (int)(4); iter++) {
      res.push_back(t);
      rotate(t + 1, t + 2, t + 5);
    }
  }
  return res;
}
vector<string> dict;
vector<vector<string> > mp;
int main() {
  string s;
  cin >> s;
  int cnt = 0;
  sort(s.begin(), s.end());
  do {
    dict.push_back(s);
    mp.push_back(rotate(s));
  } while (next_permutation(s.begin(), s.end()));
  for (int i = (0); i < (int)(dict.size()); i++) {
    bool ok = 1;
    for (int j = (i + 1); j < (int)(dict.size()); j++)
      if (ok) {
        for (int k = (0); k < (int)(mp[j].size()); k++)
          if (ok) {
            ok = (mp[j][k] != dict[i]);
          }
      }
    cnt += ok;
  }
  cout << cnt << endl;
  return 0;
}
