#include <bits/stdc++.h>
using namespace std;
bool removed[100001];
int main() {
  set<string> se;
  vector<string> v;
  string s;
  cin >> s;
  sort(s.begin(), s.end());
  do {
    se.insert(s);
  } while (next_permutation(s.begin(), s.end()));
  for (set<string>::iterator it = se.begin(); it != se.end(); it++)
    v.push_back(*it);
  int ans = 0;
  for (int i = 0; i < (int)v.size(); i++) {
    if (removed[i]) continue;
    ans++;
    string cur = v[i];
    for (int j = i + 1; j < (int)v.size(); j++) {
      string other = v[j];
      vector<string> all;
      all.push_back(cur);
      string temp = "";
      temp += cur[1];
      temp += cur[5];
      temp += cur[2];
      temp += cur[0];
      temp += cur[4];
      temp += cur[3];
      all.push_back(temp);
      temp = "";
      temp += cur[5];
      temp += cur[3];
      temp += cur[2];
      temp += cur[1];
      temp += cur[4];
      temp += cur[0];
      all.push_back(temp);
      temp = "";
      temp += cur[3];
      temp += cur[0];
      temp += cur[2];
      temp += cur[5];
      temp += cur[4];
      temp += cur[1];
      all.push_back(temp);
      temp = "";
      temp += cur[2];
      temp += cur[1];
      temp += cur[5];
      temp += cur[3];
      temp += cur[0];
      temp += cur[4];
      all.push_back(temp);
      temp = "";
      temp += cur[4];
      temp += cur[1];
      temp += cur[0];
      temp += cur[3];
      temp += cur[5];
      temp += cur[2];
      all.push_back(temp);
      for (int k = 0; k < 6; k++) {
        string curr = all[k];
        for (int u = 0; u < 4; u++) {
          string sh = curr;
          if (curr == other) removed[j] = 1;
          char tmp = curr[1];
          for (int o = 1; o < 4; o++) curr[o] = curr[o + 1];
          curr[4] = tmp;
        }
      }
    }
  }
  cout << ans;
  return 0;
}
