#include <bits/stdc++.h>
using namespace std;
char str[10];
int vis[1000], color[1000], cnt, ans;
int main() {
  scanf("%s", str);
  for (int i = 0; i <= 5; i++) {
    if (!vis[str[i]]) {
      vis[str[i]] = ++cnt;
      color[cnt] = 1;
    } else
      color[vis[str[i]]]++;
  }
  if (cnt == 1) ans = 1;
  if (cnt == 2) {
    sort(color + 1, color + 3);
    if (color[1] == 1)
      ans = 1;
    else
      ans = 2;
  }
  if (cnt == 3) {
    sort(color + 1, color + 4);
    if (color[1] == 1 && color[2] == 1) ans = 2;
    if (color[1] == 1 && color[2] == 2) ans = 3;
    if (color[1] == 2 && color[2] == 2) ans = 6;
  }
  if (cnt == 4) {
    sort(color + 1, color + 5);
    if (color[1] == 1 && color[2] == 1 && color[3] == 1) ans = 5;
    if (color[1] == 1 && color[2] == 1 && color[3] == 2) ans = 8;
  }
  if (cnt == 5) ans = 15;
  if (cnt == 6) ans = 30;
  printf("%d\n", ans);
  return 0;
}
