#include <bits/stdc++.h>
using namespace std;
set<string> S;
string rotate1(string s) {
  string s1 = s;
  s1[1] = s[2];
  s1[2] = s[4];
  s1[4] = s[5];
  s1[5] = s[1];
  return s1;
}
string rotate2(string s) {
  string s1 = s;
  s1[0] = s[1];
  s1[1] = s[3];
  s1[3] = s[4];
  s1[4] = s[0];
  return s1;
}
set<pair<string, bool> > poszlo;
void go(string s, bool sel) {
  if (!poszlo.insert(make_pair(s, sel)).second) return;
  S.insert(s);
  if (sel) {
    s = rotate2(s);
    go(s, 0);
    s = rotate2(s);
    go(s, 0);
    s = rotate2(s);
    go(s, 0);
  } else {
    s = rotate1(s);
    go(s, 1);
    s = rotate1(s);
    go(s, 1);
    s = rotate1(s);
    go(s, 1);
  }
}
int main() {
  string s;
  cin >> s;
  sort(s.begin(), s.end());
  int res = 0;
  do {
    if (S.insert(s).second) res++;
    poszlo.clear();
    go(s, 0);
    go(s, 1);
  } while (next_permutation(s.begin(), s.end()));
  printf("%d\n", res);
  return 0;
}
