import java.util.Scanner; import java.util.TreeSet; public class Main { static TreeSet mStrList = new TreeSet(); static String S = null; public static void main(String[] args) { Scanner sc = new Scanner(System.in); S = sc.next(); String str = ""; boolean[] used = new boolean[S.length()]; solve(str, used); System.out.println(mStrList.size()); } static void solve(String str, boolean[] used) { if(str.length() == S.length()) { if(!str.equals(S)) { mStrList.add(str); } return; } for(int i=0; i