#include <bits/stdc++.h>
using namespace std;
using std::string;
void rotate1(string &t) {
  char temp = t[1];
  t[1] = t[0];
  t[0] = t[3];
  t[3] = t[2];
  t[2] = temp;
}
void rotate2(string &t) {
  char temp = t[1];
  t[1] = t[4];
  t[4] = t[3];
  t[3] = t[5];
  t[5] = temp;
}
void rotate3(string &t) {
  char temp = t[0];
  t[0] = t[4];
  t[4] = t[2];
  t[2] = t[5];
  t[5] = temp;
}
string norm(string s) {
  string res = s;
  for (int(i) = 0; (i) < (2); ++(i)) {
    for (int(j) = 0; (j) < (4); ++(j)) {
      for (int(k) = 0; (k) < (4); ++(k)) {
        rotate1(s);
        res = min(res, s);
      }
      rotate3(s);
    }
    rotate1(s);
  }
  return res;
}
int main() {
  string s;
  cin >> s;
  sort(s.begin(), s.end());
  set<string> S;
  do {
    S.insert(norm(s));
  } while (next_permutation(s.begin(), s.end()));
  cout << S.size() << endl;
}
