#include <bits/stdc++.h>
using namespace std;
string str;
int per[24][6] = {{0, 1, 2, 3, 4, 5}, {0, 1, 3, 4, 5, 2}, {0, 1, 4, 5, 2, 3},
                  {0, 1, 5, 2, 3, 4}, {2, 4, 1, 3, 0, 5}, {2, 4, 3, 0, 5, 1},
                  {2, 4, 0, 5, 1, 3}, {2, 4, 5, 1, 3, 0}, {5, 3, 1, 2, 0, 4},
                  {5, 3, 2, 0, 4, 1}, {5, 3, 0, 4, 1, 2}, {5, 3, 4, 1, 2, 0},
                  {1, 0, 5, 4, 3, 2}, {1, 0, 4, 3, 2, 5}, {1, 0, 3, 2, 5, 4},
                  {1, 0, 2, 5, 4, 3}, {4, 2, 5, 0, 3, 1}, {4, 2, 0, 3, 1, 5},
                  {4, 2, 3, 1, 5, 0}, {4, 2, 1, 5, 0, 3}, {3, 5, 4, 0, 2, 1},
                  {3, 5, 0, 2, 1, 4}, {3, 5, 2, 1, 4, 0}, {3, 5, 1, 4, 0, 2}};
set<string> S;
string news;
inline string gennew(int perid, string s) {
  string s2;
  s2 = s;
  for (int i = 0; i < 6; i++) s2[per[perid][i]] = s[i];
  return s2;
}
int ans = 0;
int main() {
  cin >> str;
  news = str;
  for (int i = 0; i < 6; i++)
    for (int j = 0; j < 6; j++)
      if (i != j)
        for (int q = 0; q < 6; q++)
          if (q != i && q != j)
            for (int w = 0; w < 6; w++)
              if (w != i && w != j && w != q)
                for (int z = 0; z < 6; z++)
                  if (z != i && z != j && z != q && z != w)
                    for (int x = 0; x < 6; x++)
                      if (x != i && x != j && x != q && x != w && x != z) {
                        news[0] = str[i];
                        news[1] = str[j];
                        news[2] = str[q];
                        news[3] = str[w];
                        news[4] = str[z];
                        news[5] = str[x];
                        bool ok = true;
                        for (int o = 0; o < 24 && ok; o++) {
                          string gen = gennew(o, news);
                          if (S.find(gen) != S.end()) {
                            ok = false;
                          }
                        }
                        if (ok) {
                          ans++;
                          S.insert(news);
                        }
                      }
  cout << S.size();
}
