import java.io.*; public class Main { public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String line=br.readLine(); while(line.length()>1){ int sum=0; for(int i=0;i