import java.io.*; import java.util.ArrayList; class Main{ static final PrintWriter out=new PrintWriter(System.out); static int ans=0; public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String line=""; while((line=br.readLine())!=null&&!line.isEmpty()){ StringBuilder sb1=new StringBuilder(line); StringBuilder sb2=new StringBuilder(""); ArrayList array=new ArrayList(); dfs(sb1,sb2,array); out.println(ans); out.flush(); } } private static void dfs(StringBuilder sb1,StringBuilder sb2,ArrayList array){ if(sb1.length()==0){ String str=sb2.toString(); if(array.indexOf(str)<0){ ans++; array.add(str); } return; } String first=sb1.substring(0,1); String last=sb1.substring(sb1.length()-1); sb1.deleteCharAt(0); sb2.append(first); dfs(sb1,sb2,array); sb1.insert(0,first); sb2.deleteCharAt(sb2.length()-1); sb1.deleteCharAt(sb1.length()-1); sb2.append(last); dfs(sb1,sb2,array); sb1.append(last); sb2.deleteCharAt(sb2.length()-1); } }