#include <bits/stdc++.h>
using namespace std;
map<char, int> m;
char c;
int p[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, 4, 3, 5, 6}, {2, 1, 6, 5, 4, 3},
                {2, 1, 3, 4, 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, 6, 5, 1, 2}, {4, 3, 2, 1, 6, 5}, {4, 3, 5, 6, 2, 1},
                {4, 3, 1, 2, 5, 6}, {5, 6, 3, 4, 2, 1}, {5, 6, 1, 2, 3, 4},
                {5, 6, 4, 3, 1, 2}, {5, 6, 2, 1, 4, 3}, {6, 5, 3, 4, 1, 2},
                {6, 5, 2, 1, 3, 4}, {6, 5, 4, 3, 2, 1}, {6, 5, 1, 2, 4, 3}};
int n, a[7], b[7], id[7][7][7][7][7][7], x = 0, i, q, M = 0, ans = 0;
int main() {
  m['R'] = 1;
  m['O'] = 2;
  m['Y'] = 3;
  m['G'] = 4;
  m['B'] = 5;
  m['V'] = 6;
  for (i = 1; i <= 6; i++) {
    cin >> c;
    b[i] = m[c];
  }
  sort(b + 1, b + 7);
  do {
    for (i = 1; i <= 6; i++) {
      a[3] = b[1];
      a[4] = b[2];
      a[2] = b[3];
      a[5] = b[4];
      a[1] = b[5];
      a[6] = b[6];
      for (q = 0; q < 24; q++) {
        x = id[a[p[q][0]]][a[p[q][1]]][a[p[q][2]]][a[p[q][3]]][a[p[q][4]]]
              [a[p[q][5]]];
        if (x) break;
      }
      if (!x) {
        M++;
        id[a[1]][a[2]][a[3]][a[4]][a[5]][a[6]] = M;
        ans++;
      }
    }
  } while (next_permutation(b + 1, b + 7));
  cout << M << endl;
  return 0;
}
