// See https://aka.ms/new-console-template for more information using System.Collections; using System.ComponentModel; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; internal class Program { private const long mod = 998244353; public static long mod_pow(long x, long n, long m = mod) { x %= m; if (x < 0) x += m; long res = 1; while (n > 0) { if ((n & 1) != 0) res = res * x % m; x = x * x % m; n >>= 1; } return res; } public struct perm { public List fact; public List factinv; public perm(int n) { fact = new List(n); factinv = new List(n); fact.Add(1); for (int i = 1; i < n; i++) { long val = fact.Last(); val = val * i % mod; fact.Add((int)val); } long las = fact.Last(); long cur = mod_pow(las, mod - 2); factinv.Add((int)cur); for (int i = n - 1; i > 0; i--) { long val = factinv.Last(); val = val * i % mod; factinv.Add((int)val); } factinv.Reverse(); } public int comb(int a, int b) { if (a < 0 || b < 0 || a < b) return 0; long res = fact[a]; res = res * factinv[b] % mod; res = res * factinv[a - b] % mod; return (int)res; } } public struct BIT { public int n; public List node; public BIT(int n_) { n = n_; node = new List(n); for(int i=0;i= 0; i = (i & (i + 1)) - 1) res += node[i]; return res; } public int sum(int a, int b) { return sum(b) - sum(a); } } public static void Main(string[] args) { var n = int.Parse(Console.ReadLine()); string s = n.ToString(); var st = new HashSet(); for (int i = 0; i <= s.Length; i++) { for (int ad = 0; ad < 10; ad++) { if (i == 0 && ad == 0) continue; string ns = s; //Console.WriteLine(ad.ToString()); ns=ns.Insert(i, ad.ToString()); long val = long.Parse(ns); st.Add(val); //Console.WriteLine(ns); } } int ans = st.Count(); Console.WriteLine(ans); } public static List mkar(int n, int val) { List res = new List(n); for(int i=0;i