import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.util.Arrays; import java.util.NoSuchElementException; import java.util.Scanner; public class Main { public static void main(String[] args) throws FileNotFoundException { long t = System.currentTimeMillis(); new Main().run(); System.err.println(System.currentTimeMillis() - t); } long gcd(long a,long b) { return a==0?b:gcd(b%a,a); } void run() { Scanner sc = new Scanner(System.in); char[] cs=sc.next().toCharArray(); int[] cnt=new int[cs.length]; for(char c:cs)cnt[(int)(c-'A')]++; int[] divs=new int[cs.length]; { int p=0; for(int i=0;i