#include <bits/stdc++.h>
using namespace std;
const long long int N = 1e6 + 5;
const long long int mod = 1e18 + 7;
const double E = 2.71828;
const double PI = 3.14159265;
long long int arr[24][6] = {
    {0, 1, 2, 3, 4, 5}, {0, 2, 3, 4, 1, 5}, {0, 3, 4, 1, 2, 5},
    {0, 4, 1, 2, 3, 5}, {1, 2, 0, 4, 5, 3}, {1, 0, 4, 5, 2, 3},
    {1, 4, 5, 2, 0, 3}, {1, 5, 2, 0, 4, 3}, {2, 5, 3, 0, 1, 4},
    {2, 3, 0, 1, 5, 4}, {2, 0, 1, 5, 3, 4}, {2, 1, 5, 3, 0, 4},
    {3, 2, 5, 4, 0, 1}, {3, 5, 4, 0, 2, 1}, {3, 4, 0, 2, 5, 1},
    {3, 0, 2, 5, 4, 1}, {4, 0, 3, 5, 1, 2}, {4, 3, 5, 1, 0, 2},
    {4, 5, 1, 0, 3, 2}, {4, 1, 0, 3, 5, 2}, {5, 4, 3, 2, 1, 0},
    {5, 3, 2, 1, 4, 0}, {5, 2, 1, 4, 3, 0}, {5, 1, 4, 3, 2, 0}};
set<string> ss;
int main() {
  ios::sync_with_stdio(false);
  string s;
  cin >> s;
  sort(s.begin(), s.end());
  ss.insert(s);
  while (next_permutation(s.begin(), s.end())) {
    bool presen = false;
    for (long long int i = 0; i < 24; i++) {
      string x = "";
      for (long long int j = 0; j < 6; j++) {
        x += s[arr[i][j]];
      }
      if ((ss.find(x) != ss.end())) {
        presen = true;
      }
    }
    if (!presen) {
      ss.insert(s);
    }
  }
  cout << ss.size() << endl;
  return 0;
}
