#include <iostream>
using namespace std;
void count()
{
int n=0,x=0,cnt=0;
cin >> n >> x;
for(int i=1;i<=n;i++){
int temp = i;
if(temp<10){
if(temp == x) cnt++;
}
else{
while(temp > 0){
if(temp%10 == x) cnt++;
temp /= 10;
}
}
}
cout << cnt << endl;
}
int main() {
count();
return 0;
}

京公网安备 11010502036488号