#include <bits/stdc++.h>
using namespace std;
struct state {
  string a;
};
state init;
set<string> ans, sol;
state rotate_horiz(state tmp) {
  state ret = tmp;
  ret.a[1] = tmp.a[4];
  ret.a[3] = tmp.a[5];
  ret.a[4] = tmp.a[3];
  ret.a[5] = tmp.a[1];
  return (ret);
}
state rotate_vert(state tmp) {
  state ret = tmp;
  for (int i = 0; i < 4; ++i) {
    ret.a[i] = tmp.a[(i + 1) % 4];
  }
  return (ret);
}
void solve(state tmp) {
  if (sol.find(tmp.a) != sol.end()) {
    return;
  }
  sol.insert(tmp.a);
  solve(rotate_horiz(tmp));
  solve(rotate_vert(tmp));
}
int main() {
  cin >> init.a;
  sort(init.a.begin(), init.a.end());
  do {
    sol.clear();
    solve(init);
    if (ans.find(*sol.begin()) == ans.end()) {
      ans.insert(*sol.begin());
    }
  } while (next_permutation(init.a.begin(), init.a.end()));
  printf("%d\n", (int)ans.size());
  return 0;
}
