#include <bits/stdc++.h>
long long int D_C[50][50] = {0};
long long int D[10] = {0};
long long int F[10] = {0};
long long int nCr(long long int n, long long int r) {
  if (D_C[n][r]) return D_C[n][r];
  if (n <= 1 || r == 0 || r == n)
    D_C[n][r] = 1;
  else
    D_C[n][r] += nCr(n - 1, r - 1) + nCr(n - 1, r);
  return D_C[n][r];
}
long long int f(long long int dig);
int main() {
  char inp[30];
  scanf("%s", inp);
  for (long long int i = 0; inp[i] != 0; i++) {
    if (inp[i] >= '0' && inp[i] <= '9') {
      D[inp[i] - '0']++;
    }
  }
  printf("%lld", f(0));
  return 0;
}
long long int f(long long int dig) {
  if (dig == 10) {
    long long int len = 0, rtn = 1;
    for (long long int i = 0; i < 10; i++) len += F[i];
    if (F[0]) {
      rtn *= nCr(len - 1, F[0]);
      len -= F[0];
    }
    for (long long int i = 1; i <= 9; i++) {
      if (F[i]) {
        rtn *= nCr(len, F[i]);
        len -= F[i];
      }
    }
    return rtn;
  } else if (D[dig] == 0)
    return f(dig + 1);
  else {
    long long int rtn = 0;
    for (long long int i = 1; i <= D[dig]; i++) {
      F[dig] = i;
      rtn += f(dig + 1);
    }
    return rtn;
  }
}
