#include <bits/stdc++.h>
using namespace std;
string clr;
set<string> vars;
string rotate(string s, int a, int b, int c, int d) {
  char ch;
  ch = s[a];
  s[a] = s[b];
  s[b] = s[c];
  s[c] = s[d];
  s[d] = ch;
  return s;
}
string rotate1(string s) { return rotate(s, 1, 2, 3, 4); }
string rotate2(string s) { return rotate(s, 0, 2, 5, 4); }
string rotate3(string s) { return rotate(s, 1, 0, 3, 5); }
void all_rotation(string s, set<string> &used) {
  if (used.find(s) == used.end()) {
    used.insert(s);
    all_rotation(rotate1(s), used);
    all_rotation(rotate2(s), used);
    all_rotation(rotate3(s), used);
  }
}
string min_rotation(string s) {
  set<string> used;
  all_rotation(s, used);
  return *used.begin();
}
int main() {
  cin >> clr;
  sort(clr.begin(), clr.end());
  do {
    vars.insert(min_rotation(clr));
  } while (next_permutation(clr.begin(), clr.end()));
  cout << vars.size();
  return 0;
}
