#include <bits/stdc++.h>
using namespace std;
ifstream fin("AAtest.in.txt");
string s, t[3], u;
vector<string> vas, v;
bool b[6];
int vast;
void mine(int k, int p) {
  if (k == 3) {
    string w[3];
    for (int(i) = (0); ((i)) < ((3)); ((i))++) w[i] = t[i];
    sort(w, w + 3);
    u = w[0] + w[1] + w[2];
    bool oli = 0;
    for (string s : v)
      if (u == s) oli = 1;
    if (!oli) {
      v.emplace_back(u);
      vast++;
      bool pole = 1;
      for (int(i) = (0); ((i)) < ((6)); ((i))++)
        if (i % 2 and u[i] == u[i - 1]) pole = 0;
      if (w[0] == w[1] or w[1] == w[2]) pole = 0;
      if (pole) vast++;
    }
    return;
  } else {
    int i = p;
    while (b[i]) i++;
    t[k][0] = s[i];
    b[i] = 1;
    int j = i;
    while (j < 6) {
      if (!b[j]) {
        t[k][1] = s[j];
        b[j] = 1;
        mine(k + 1, i);
        b[j] = 0;
      }
      j++;
    }
    b[i] = 0;
    return;
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cerr.tie(0);
  for (int(i) = (0); ((i)) < ((3)); ((i))++) t[i] = "aa";
  cin >> s;
  sort(s.begin(), s.end());
  mine(0, 0);
  cout << vast;
}
