#include <bits/stdc++.h>
using namespace std;
const int oo = (1 << 30);
const int mod = (int)1e9 + 7;
const double PI = acos(-1.0);
set<string> S;
void rota(string& s) {
  int t[6] = {1, 4, 3, 6, 2, 5};
  for (int i = 0; i < 6; i++) t[i]--;
  char tmp[6];
  for (int i = 0; i < 6; i++) tmp[t[i]] = s[i];
  for (int i = 0; i < 6; i++) s[i] = tmp[i];
}
void rotb(string& s) {
  int t[6] = {5, 2, 4, 1, 3, 6};
  for (int i = 0; i < 6; i++) t[i]--;
  char tmp[6];
  for (int i = 0; i < 6; i++) tmp[t[i]] = s[i];
  for (int i = 0; i < 6; i++) s[i] = tmp[i];
}
void rotc(string& s) {
  int t[6] = {6, 1, 2, 4, 5, 3};
  for (int i = 0; i < 6; i++) t[i]--;
  char tmp[6];
  for (int i = 0; i < 6; i++) tmp[t[i]] = s[i];
  for (int i = 0; i < 6; i++) s[i] = tmp[i];
}
bool check(string s) {
  for (int a = 0; a < 4; a++) {
    for (int b = 0; b < 4; b++) {
      for (int c = 0; c < 4; c++) {
        if (S.find(s) != S.end()) return false;
        rotc(s);
      }
      rotb(s);
    }
    rota(s);
  }
  for (int a = 0; a < 4; a++) {
    for (int b = 0; b < 4; b++) {
      for (int c = 0; c < 4; c++) {
        S.insert(s);
        rotc(s);
      }
      rotb(s);
    }
    rota(s);
  }
  return true;
}
int main() {
  string s;
  cin >> s;
  sort((s).begin(), (s).end());
  int ans = 0;
  do {
    if (check(s)) ans++;
  } while (next_permutation((s).begin(), (s).end()));
  cout << ans << endl;
  return 0;
}
