Practice on Toph

Participate in exhilarating programming contests, solve unique algorithm and data structure challenges and be a part of an awesome community.

Jini and the One

By masrur · Limits 1s, 512 MB

Jini’s favorite number is one. She always looks for one in any number and if she finds the digit 1 in a number then she considers that this is a lucky number. Now counting till a large number while finding numbers that have digit 1 at least once in them can be hard for her. Thus she needs your help.

Given NN can you find her how many numbers from 11 to NN contain digit 11 at least once?

Input

The input contains a single integer NNwhere 1N1061≤N≤10^{6}

Output

Print an Integer that indicates number of integers that has digit 11 at least once.

Samples

InputOutput
19
11
InputOutput
23
12

In the first example, N=19N = 19 so the answer will be 1111 since 1,10,11,12,13,14,15,16,17,18,191,10,11,12,13,14,15,16,17,18,19 are the numbers that have digit 11 in them at least once.

    Discussion

    Statistics


    100% Solution Ratio

    MursaleenEarliest, 4d ago

    Tahmid690Fastest, 0.0s

    MursaleenLightest, 131 kB

    bokaifShortest, 60B

    Submit

    Login to submit