{"raw_statement":[{"iden":"problem statement","content":"There is a string $S$ consisting of digits `1`, `2`, $...$, `9`. Lunlun, the Dachshund, will take out three consecutive digits from $S$, treat them as a single integer $X$ and bring it to her master. (She cannot rearrange the digits.)\nThe master's favorite number is $753$. The closer to this number, the better. What is the minimum possible (absolute) difference between $X$ and $753$?"},{"iden":"constraints","content":"*   $S$ is a string of length between $4$ and $10$ (inclusive).\n*   Each character in $S$ is `1`, `2`, $...$, or `9`."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$S$"},{"iden":"sample input 1","content":"1234567876"},{"iden":"sample output 1","content":"34\n\nTaking out the seventh to ninth characters results in $X = 787$, and the difference between this and $753$ is $787 - 753 = 34$. The difference cannot be made smaller, no matter where $X$ is taken from.\nNote that the digits cannot be rearranged. For example, taking out `567` and rearranging it to `765` is not allowed.\nWe cannot take out three digits that are not consecutive from $S$, either. For example, taking out the seventh digit `7`, the ninth digit `7` and the tenth digit `6` to obtain `776` is not allowed."},{"iden":"sample input 2","content":"35753"},{"iden":"sample output 2","content":"0\n\nIf `753` itself can be taken out, the answer is $0$."},{"iden":"sample input 3","content":"1111111111"},{"iden":"sample output 3","content":"642\n\nNo matter where $X$ is taken from, $X = 111$, with the difference $753 - 111 = 642$."}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}