Hanako heard that if you pick any non-negative integer, it always turns up somewhere in the decimal expansion of π=3.14159265…. Since then, whenever she sees a sequence of digits she checks which integers appear in it.
An integer appears in the sequence if you can read it off consecutive digits, in order, as a decimal number. A value of two or more digits must not start with 0. For example, the sequence 3 0 1 contains the integers 3, 0, 1, 30 and 301, five in total.
Hanako wants the smallest non-negative integer that does not appear in the sequence. The sequence above contains 0 and 1 but not 2, so the answer is 2.
Write a program that answers Hanako's question.