#include <bits/stdc++.h>
using namespace std;
vector<int> z[10];
int main() {
  vector<int> p[24];
  p[0] = {0, 1, 2, 3, 4, 5};
  p[1] = {0, 4, 3, 2, 1, 5};
  p[2] = {0, 2, 4, 1, 3, 5};
  p[3] = {0, 3, 1, 4, 2, 5};
  p[4] = {5, 1, 3, 2, 4, 0};
  p[5] = {5, 4, 2, 3, 1, 0};
  p[6] = {5, 3, 4, 1, 2, 0};
  p[7] = {5, 2, 1, 4, 3, 0};
  p[8] = {2, 1, 5, 0, 4, 3};
  p[9] = {2, 4, 0, 5, 1, 3};
  p[10] = {2, 5, 4, 1, 0, 3};
  p[11] = {2, 0, 1, 4, 5, 3};
  p[12] = {3, 1, 0, 5, 4, 2};
  p[13] = {3, 4, 5, 0, 1, 2};
  p[14] = {3, 0, 4, 1, 5, 2};
  p[15] = {3, 5, 1, 4, 0, 2};
  p[16] = {1, 0, 3, 2, 5, 4};
  p[17] = {1, 5, 2, 3, 0, 4};
  p[18] = {1, 3, 5, 0, 2, 4};
  p[19] = {1, 2, 0, 5, 3, 4};
  p[20] = {4, 0, 2, 3, 5, 1};
  p[21] = {4, 5, 3, 2, 0, 1};
  p[22] = {4, 2, 5, 0, 3, 1};
  p[23] = {4, 3, 0, 5, 2, 1};
  string s;
  cin >> s;
  set<string> z;
  for (int i = 0; i < 720; i++) {
    int f = 0;
    for (int j = 0; j < 24; j++) {
      string e = "";
      for (int k = 0; k < 6; k++) e += s[p[j][k]];
      f |= z.find(e) != z.end();
    }
    if (!f) z.insert(s);
    next_permutation(s.begin(), s.end());
  }
  cout << z.size() << "\n";
  return 0;
}
