#include <bits/stdc++.h>
using namespace std;
const int permutation[24] = {0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1,
                             2, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0};
string fun(string s, int i1, int i2, int i3, int i4, int i5, int i6) {
  string st = "";
  st += s[i1 - 1];
  st += s[i2 - 1];
  st += s[i3 - 1];
  st += s[i4 - 1];
  st += s[i5 - 1];
  st += s[i6 - 1];
  string massiv[30];
  int kol = 0;
  for (int i = 1; i <= 24; i++) {
    kol += 1;
    massiv[kol] = st;
    char s1, s2, s3, s4, s5, s6;
    s1 = st[0];
    s2 = st[1];
    s3 = st[2];
    s4 = st[3];
    s5 = st[4];
    s6 = st[5];
    if (permutation[i] == 0) {
      string nst = "";
      nst += s1;
      nst += s2;
      nst += s6;
      nst += s5;
      nst += s3;
      nst += s4;
      st = nst;
    };
    if (permutation[i] == 1) {
      string nst = "";
      nst += s4;
      nst += s3;
      nst += s1;
      nst += s2;
      nst += s5;
      nst += s6;
      st = nst;
    };
    if (permutation[i] == 2) {
      string nst = "";
      nst += s2;
      nst += s1;
      nst += s5;
      nst += s6;
      nst += s3;
      nst += s4;
      st = nst;
    };
  };
  vector<string> qwerty;
  for (int i = 1; i <= 24; i++) qwerty.push_back(massiv[i]);
  sort(qwerty.begin(), qwerty.end());
  return qwerty[0];
};
int main() {
  string s;
  cin >> s;
  int count = 0;
  string mas[1000];
  int i1 = 0, i2 = 0, i3 = 0, i4 = 0, i5 = 0, i6 = 0;
  for (i1 = 1; i1 <= 6; i1++)
    for (i2 = 1; i2 <= 6; i2++)
      for (i3 = 1; i3 <= 6; i3++)
        for (i4 = 1; i4 <= 6; i4++)
          for (i5 = 1; i5 <= 6; i5++)
            for (i6 = 1; i6 <= 6; i6++) {
              if (i1 == i2) continue;
              if (i1 == i3) continue;
              if (i1 == i4) continue;
              if (i1 == i5) continue;
              if (i1 == i6) continue;
              if (i2 == i3) continue;
              if (i2 == i4) continue;
              if (i2 == i5) continue;
              if (i2 == i6) continue;
              if (i3 == i4) continue;
              if (i3 == i5) continue;
              if (i3 == i6) continue;
              if (i4 == i5) continue;
              if (i4 == i6) continue;
              if (i5 == i6) continue;
              count += 1;
              mas[count] = fun(s, i1, i2, i3, i4, i5, i6);
            };
  bool met[1001];
  for (int i = 1; i <= 720; i++) met[i] = true;
  int res = 0;
  for (int i = 1; i <= 720; i++) {
    if (met[i] == false) continue;
    res += 1;
    for (int j = i + 1; j <= 720; j++)
      if (mas[i] == mas[j]) met[j] = false;
  };
  cout << res << endl;
  return 0;
};
