#include <bits/stdc++.h>
using namespace std;
set<string> sx;
string rot(int a, int b, int c, string s) {
  string str = "";
  str += s[0];
  str += s[1];
  str += s[2];
  str += s[3];
  while (a--) {
    str = str.substr(1, 3) + str[0];
  }
  s[0] = str[0];
  s[1] = str[1];
  s[2] = str[2];
  s[3] = str[3];
  str = "";
  str += s[4];
  str += s[1];
  str += s[5];
  str += s[3];
  while (b--) {
    str = str.substr(1, 3) + str[0];
  }
  s[4] = str[0];
  s[1] = str[1];
  s[5] = str[2];
  s[3] = str[3];
  str = "";
  str += s[0];
  str += s[4];
  str += s[2];
  str += s[5];
  while (c--) {
    str = str.substr(1, 3) + str[0];
  }
  s[0] = str[0];
  s[4] = str[1];
  s[2] = str[2];
  s[5] = str[3];
  return s;
}
void make(string s) {
  bool flag = 0;
  if (!sx.size()) {
    sx.insert(s);
    return;
  }
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 4; j++) {
      for (int k = 0; k < 4; k++) {
        if (sx.find(rot(i, j, k, s)) != sx.end()) {
          flag = 1;
          break;
        }
      }
      if (flag) break;
    }
    if (flag) break;
  }
  if (!flag) sx.insert(s);
}
int main() {
  string s;
  cin >> s;
  sort(s.begin(), s.end());
  do {
    make(s);
  } while (next_permutation(s.begin(), s.end()));
  cout << sx.size() << endl;
  return 0;
}
