#include<iostream> using namespace std; int main() { int n,c,nr,x,y; cout<<"n="; cin>>n; cout<<"c="; cin>>c; nr=0; for(x=1;x<=n;x++) { y=x; while(y>0) { if(y%10==c) nr++; y=y/10; } } cout<<nr; return 0; }