import java.util.*; 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 k = 0; k <= s.length(); k++) { String pre; String post; int start = 0; if (k == 0) { pre = ""; post = s; start = 1; } else if (k == s.length()) { pre = s; post = ""; } else { pre = s.substring(0, k); post = s.substring(k); } for (int i = start; i <= 9; i++) { String numString = pre + i + post; set.add(Long.parseLong(numString)); } } System.out.println(set.size()); } }