import java.io.*; import java.util.*; import java.util.stream.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); char[] inputs = sc.next().toCharArray(); int length = inputs.length; System.out.println(9 * (length + 1)); } }