import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.HashSet; import java.util.Set; public class No170 { static Set set = new HashSet(); public static void main(String[] args) { try { BufferedReader br = new BufferedReader(new InputStreamReader( System.in)); String S = br.readLine(); perm1(S); System.out.println(set.size() - 1); } catch (Exception e) { System.err.println("Error:" + e.getMessage()); } } public static void perm1(String s) { perm1("", s); } private static void perm1(String prefix, String s) { int N = s.length(); if (N == 0) set.add(prefix); // System.out.println(prefix); else { for (int i = 0; i < N; i++) perm1(prefix + s.charAt(i), s.substring(0, i) + s.substring(i + 1, N)); } } }