import java.util.HashSet; import java.util.Scanner; import java.util.Set; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); String s = sc.next(); sc.close(); Set set = new HashSet<>(); for (int i = 0; i <= s.length(); i++) { for (int j = 0; j <= 9; j++) { String t = s.substring(0, i) + j + s.substring(i); long v = Long.parseLong(t); set.add(v); } } set.remove(Long.parseLong(s)); System.out.println(set.size()); } }