Why wouldn't you try this? If the answer is 1336, then this works.
Code:
for i = 1 to 3333
for j = 1 to len(Cstr(i))
if Asc(Mid(CStr(i),j,1)) = 51 Then
iCnt = iCnt+1
End If
Next
Next