#include <bits/stdc++.h>
using namespace std;
map<string, bool> a;
int pos[24][6] = {{1, 2, 3, 4, 5, 6}, {1, 2, 6, 5, 3, 4}, {1, 2, 4, 3, 6, 5},
                  {1, 2, 5, 6, 4, 3}, {2, 1, 3, 4, 6, 5}, {2, 1, 6, 5, 4, 3},
                  {2, 1, 4, 3, 6, 5}, {2, 1, 5, 6, 3, 4}, {3, 4, 2, 1, 5, 6},
                  {3, 4, 6, 5, 2, 1}, {3, 4, 1, 2, 6, 5}, {3, 4, 5, 6, 1, 2},
                  {4, 3, 2, 1, 6, 5}, {4, 3, 5, 6, 2, 1}, {4, 3, 1, 2, 5, 6},
                  {4, 3, 6, 5, 1, 2}, {5, 6, 3, 4, 2, 1}, {5, 6, 2, 1, 4, 3},
                  {5, 6, 4, 3, 1, 2}, {5, 6, 1, 2, 3, 4}, {6, 5, 3, 4, 1, 2},
                  {6, 5, 1, 2, 4, 3}, {6, 5, 4, 3, 2, 1}, {6, 5, 2, 1, 3, 4}};
int main() {
  char s0[10];
  scanf("%s", &s0);
  a.clear();
  int cnt = 0;
  for (int c1 = 0; c1 < 6; c1++)
    for (int c2 = 0; c2 < 6; c2++)
      for (int c3 = 0; c3 < 6; c3++)
        for (int c4 = 0; c4 < 6; c4++)
          for (int c5 = 0; c5 < 6; c5++)
            for (int c6 = 0; c6 < 6; c6++) {
              if (c1 == c2 || c1 == c3 || c1 == c4 || c1 == c5 || c1 == c6 ||
                  c2 == c3 || c2 == c4 || c2 == c5 || c2 == c6 || c3 == c4 ||
                  c3 == c5 || c3 == c6 || c4 == c5 || c4 == c6 || c5 == c6) {
                continue;
              }
              char tmp[6];
              for (int i = 0; i < 24; i++) {
                tmp[pos[i][0] - 1] = s0[c1];
                tmp[pos[i][1] - 1] = s0[c2];
                tmp[pos[i][2] - 1] = s0[c3];
                tmp[pos[i][3] - 1] = s0[c4];
                tmp[pos[i][4] - 1] = s0[c5];
                tmp[pos[i][5] - 1] = s0[c6];
                string s = "";
                for (int j = 0; j < 6; j++) s += tmp[j];
                if (i == 0 && (a.find(s) == a.end() || a[s] == false)) {
                  cnt++;
                }
                a[s] = true;
              }
            }
  printf("%d\n", cnt);
}
