import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
int sum = 0;
for(int i=1;i<=n;i++) {
String s = i+"";
for(int j=0;j<s.length();j++) {
//三种方法都可以
int t = Integer.parseInt(s.charAt(j)+"");//1
// int t = Integer.valueOf(s.charAt(j)+"");//2
// int t = Integer.valueOf(s.charAt(j))-'0';//3
if(t == m) {
sum++;
}
}
}
System.out.println(sum);
}
}
文章评论