#include <bits/stdc++.h>
using namespace std;
const int r[24][6] = {
    {1, 2, 3, 4, 5, 6}, {2, 3, 4, 1, 5, 6}, {3, 4, 1, 2, 5, 6},
    {4, 1, 2, 3, 5, 6}, {1, 4, 3, 2, 6, 5}, {2, 1, 4, 3, 6, 5},
    {3, 2, 1, 4, 6, 5}, {4, 3, 2, 1, 6, 5}, {1, 6, 3, 5, 2, 4},
    {5, 1, 6, 3, 2, 4}, {3, 5, 1, 6, 2, 4}, {6, 3, 5, 1, 2, 4},
    {1, 5, 3, 6, 4, 2}, {6, 1, 5, 3, 4, 2}, {3, 6, 1, 5, 4, 2},
    {5, 3, 6, 1, 4, 2}, {2, 5, 4, 6, 1, 3}, {6, 2, 5, 4, 1, 3},
    {4, 6, 2, 5, 1, 3}, {5, 4, 6, 2, 1, 3}, {2, 6, 4, 5, 3, 1},
    {5, 2, 6, 4, 3, 1}, {4, 5, 2, 6, 3, 1}, {6, 4, 5, 2, 3, 1}};
int n, m;
int i, j, k, l;
char s[11], c[11];
char w[1000][7];
int p[9];
bool u[9];
void gen(int i) {
  if (i == n) {
    int k, j, l;
    bool o, q;
    q = true;
    for (j = 0; q && j < 24; ++j) {
      for (k = 0; k < n; ++k) c[k] = s[p[r[j][k] - 1]];
      for (l = 0; l < m; ++l)
        if (strcmp(c, w[l]) == 0) {
          q = false;
          break;
        }
    }
    if (q) {
      strcpy(w[m], c);
      ++m;
    }
    return;
  }
  for (int k = 0; k < 6; ++k)
    if (!u[k]) {
      u[k] = 1;
      p[i] = k;
      gen(i + 1);
      u[k] = 0;
    }
}
int main() {
  n = 6;
  cin >> s;
  m = 0;
  gen(0);
  cout << m << endl;
  return 0;
}
