题目
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int res = 0;
int x = sc.nextInt();
for(int i=1;i<=n;i++) {
String s = i + "";
for(int j=0;j<s.length();j++) {
int c = s.charAt(j) - '0';
if(c == x)
res++;
}
}
System.out.println(res);
}
}