{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eAccording to a tale, in the sacred Indian city of Benares, beneath a temple\r\nthat marked the center of the world, Brahma put three diamond needles and\r\nplaced 64 gold disks on them. Priests of the temple are busy transferring the\r\ndisks from needle to needle. It is believed that the world will perish as soon\r\nas the task is done.\r\n\u003c/div\u003e\u003c/div\u003e\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eAnother legend is known in Ural. It is said that a monastery is lost in woods\r\nat the boundary of Europe and Asia, where the mythical stone flower grew. The\r\nmonks who live there are doomed to write positive integers on parchment until\r\nthe Last Judgement. Nobody knows when and where they started this work. There\r\nis a legend among monks that when the monastery had been built its first abbot\r\nwas visited in his dream by the Archangel Gabriel, who showed a stone on the\r\nslopes of the Ural mountains where a string of digits was carved. Gabriel\r\nordered to write all the integers starting from the smallest integer that was\r\nnot a substring of that string. If this legend is true, which integer was\r\nwritten by the monks first?\u003c/div\u003e\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eThe only input line contains the nonempty string consisting of decimal digits carved on the\r\nstone. The length of the string does not exceed 10\u003csup\u003e5\u003c/sup\u003e.\r\n\u003c/div\u003e\u003c/div\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eOutput the positive integer that is the first number written by the\r\nmonks.\u003c/div\u003e\u003c/div\u003e"}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e10123456789\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e11\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}