#include <bits/stdc++.h>
using namespace std;
const int MAX = 10;
char s[MAX];
int zz[30][10] = {
    {0, 1, 2, 3, 4, 5}, {0, 1, 3, 2, 5, 4}, {0, 1, 4, 5, 3, 2},
    {0, 1, 5, 4, 2, 3}, {1, 0, 3, 2, 4, 5}, {1, 0, 2, 3, 5, 4},
    {1, 0, 4, 5, 2, 3}, {1, 0, 5, 4, 3, 2}, {2, 3, 1, 0, 4, 5},
    {2, 3, 0, 1, 5, 4}, {2, 3, 5, 4, 1, 0}, {2, 3, 4, 5, 0, 1},
    {3, 2, 0, 1, 4, 5}, {3, 2, 1, 0, 5, 4}, {3, 2, 5, 4, 0, 1},
    {3, 2, 4, 5, 1, 0}, {4, 5, 2, 3, 1, 0}, {4, 5, 3, 2, 0, 1},
    {4, 5, 0, 1, 2, 3}, {4, 5, 1, 0, 3, 2}, {5, 4, 2, 3, 0, 1},
    {5, 4, 3, 2, 1, 0}, {5, 4, 0, 1, 3, 2}, {5, 4, 1, 0, 2, 3},
};
struct node {
  vector<char> arr;
  bool operator==(const node &b) {
    for (int i = 0; i < 24; i++) {
      bool ok = 1;
      for (int j = 0; j < 6; j++) {
        if (arr[zz[i][j]] != b.arr[j]) {
          ok = 0;
          break;
        }
      }
      if (ok) return 1;
    }
    return 0;
  }
  void print() const {
    for (int i = 0; i < 6; i++) printf("%c", arr[i]);
    printf("\n");
  }
};
int track[MAX];
vector<node> ans;
void sol(int pos) {
  if (pos == 6) {
    node add;
    for (int i = 0; i < 6; i++) {
      add.arr.push_back(s[track[i]]);
    }
    bool find = 0;
    for (int i = 0; i < ans.size(); i++) {
      if (ans[i] == add) {
        find = 1;
        break;
      };
    }
    if (!find) ans.push_back(add);
  } else {
    for (int i = pos; i < 6; i++) {
      swap(track[pos], track[i]);
      sol(pos + 1);
      swap(track[pos], track[i]);
    }
  }
}
int main() {
  scanf("%s", s);
  for (int i = 0; i < 6; i++) track[i] = i;
  sol(0);
  printf("%d\n", ans.size());
  for (int i = 0; i < ans.size(); i++) {
    for (int j = i + 1; j < ans.size(); j++) assert(!(ans[i] == ans[j]));
  }
  return 0;
}
