#include <bits/stdc++.h>
using namespace std;
void rotx(string &s) {
  string t = s;
  t[0] = s[1];
  t[1] = s[5];
  t[5] = s[3];
  t[3] = s[0];
  s = t;
}
void roty(string &s) {
  string t = s;
  t[0] = s[4];
  t[2] = s[0];
  t[5] = s[2];
  t[4] = s[5];
  s = t;
}
void rotz(string &s) {
  string t = s;
  t[1] = s[4];
  t[2] = s[1];
  t[3] = s[2];
  t[4] = s[3];
  s = t;
}
string lexmin(string s) {
  string ans = s;
  for (int i = 0; i < (6); i++) {
    for (int j = 0; j < (4); j++) {
      ans = min(ans, s);
      rotz(s);
    }
    if (i & 1)
      rotx(s);
    else
      roty(s);
  }
  return ans;
}
int main() {
  string s;
  cin >> s;
  sort(s.begin(), s.end());
  set<string> S;
  do {
    S.insert(lexmin(s));
  } while (next_permutation(s.begin(), s.end()));
  cout << S.size() << endl;
  return 0;
}
