/*
给一个不多于5位的正整数
1、求他是几位数
2、逆序打印各位数字
*/
public class Test7

{
  public static void main(String[] args){
    java.util.Scanner s = new java.util.Scanner(System.in);
    int i = s.nextInt();
    int j,weishu = 0,k;
    j = i;
    while(j > 0){
      weishu += 1;
      j /= 10;
    }
    System.out.println("位数为" + weishu);
    System.out.print("逆向输出为");
    while(i > 0){
      k = i % 10;
      i /= 10;
    System.out.print(k);
    }
  }
}