ll@n,a=1d5;REP(i,a){auto s=to_string(i+1);a-=stol(s+s+s)>n;}wt(a);