#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
const int inf = 1000000002;
inline int Str2Int(string s) { return atoi(s.c_str()); }
inline string Int2Str(int i) {
  ostringstream ous;
  ous << i;
  return ous.str();
}
int dx[7] = {0, 2, 3, 4, 1, 5, 6};
int dy[7] = {0, 5, 2, 6, 4, 3, 1};
int dz[7] = {0, 1, 5, 3, 6, 4, 2};
const int maxn = 100000;
void perm(char a[7], int p[7]) {
  char c[7];
  for (int i = 1; i <= 6; ++i) c[i] = a[i];
  for (int i = 1; i <= 6; ++i) a[i] = c[p[i]];
}
int a[7];
char b[7];
char ans[maxn][7];
int main() {
  string s;
  cin >> s;
  for (int i = 1; i <= 6; ++i) a[i] = i;
  int k = 0;
  do {
    for (int i = 1; i <= 6; ++i) b[i] = s[a[i] - 1];
    bool prov = false;
    for (int j = 0; j < k; ++j) {
      for (int q1 = 0; q1 < 4; ++q1) {
        for (int q2 = 0; q2 < 4; ++q2) {
          for (int q3 = 0; q3 < 4; ++q3) {
            bool p = true;
            for (int i = 1; i <= 6; ++i) {
              if (ans[j][i] != b[i]) p = false;
            }
            if (p) prov = true;
            perm(b, dz);
          }
          perm(b, dy);
        }
        perm(b, dx);
      }
    }
    if (!prov) {
      for (int i = 1; i <= 6; ++i) ans[k][i] = b[i];
      ++k;
    }
  } while (next_permutation(a + 1, a + 7));
  cout << k << endl;
  return 0;
}
