n = WScript.Arguments(0)
If n < 1 Then n = 1

Set X = CreateObject("Scripting.Dictionary")
c = 0
For i = 1 To N
    X.Add Hex(i), i
Next

For i = n To 1 step -1
    If X.Exists(CStr(i)) Then c = c + 1
Next
WScript.Echo c