import java.util.HashSet; import java.util.Scanner; import java.util.Set; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String S = scanner.next(); Set s = new HashSet<>(); f(S, "", s); System.out.println(s.size()); } private static void f(String remaining, String newString, Set set) { if (remaining.length() == 1) { set.add(newString + remaining); } else { String str = remaining.substring(1); f(str, newString + remaining.charAt(0), set); String str2 = remaining.substring(0, remaining.length() - 1); f(str2, newString + remaining.charAt(remaining.length() - 1), set); } } }