#include <bits/stdc++.h> using namespace std; int main(){ int i,n,x,t,c = 0; cin>>n>>x; for(i = 1;i <= n;i++){ t = i; while(t != 0){ if(t % 10 == x){ c++; } t = t / 10; } } cout<<c<<endl; } /************************************************************** Problem: 1469 User: admin Language: C++ Result: Accepted Time:33 ms Memory:2072 kb ****************************************************************/