import java.util.ArrayDeque; import java.util.Arrays; import java.util.Deque; import java.util.HashSet; import java.util.Scanner; import java.util.Set; public class Main { @SuppressWarnings("resource") public static void main(String args[]) { Scanner scanner = new Scanner(System.in); String s[]=scanner.next().split(""); Dequeque=new ArrayDeque<>(); que.addAll(Arrays.asList(s)); dfs("",que); System.out.println(set.size()); } static Setset=new HashSet<>(); private static void dfs(String string, Deque que) { if(que.isEmpty()) { set.add(string); return; } Dequeque1=new ArrayDeque<>(que); Dequeque2=new ArrayDeque<>(que); String t=string+que1.pop(); String c=string+que2.removeLast(); dfs(t,que1); dfs(c,que2); } }