{"raw_statement":[{"iden":"statement","content":"You are given a string _s_ consisting of lowercase Latin letters. Character _c_ is called _k_\\-dominant iff each substring of _s_ with length at least _k_ contains this character _c_.\n\nYou have to find minimum _k_ such that there exists at least one _k_\\-dominant character."},{"iden":"input","content":"The first line contains string _s_ consisting of lowercase Latin letters (1 ≤ |_s_| ≤ 100000)."},{"iden":"output","content":"Print one number — the minimum value of _k_ such that there exists at least one _k_\\-dominant character."},{"iden":"examples","content":"Input\n\nabacaba\n\nOutput\n\n2\n\nInput\n\nzzzzz\n\nOutput\n\n1\n\nInput\n\nabcde\n\nOutput\n\n3"}],"translated_statement":[{"iden":"statement","content":"给定一个由小写拉丁字母组成的字符串 #cf_span[s]。字符 #cf_span[c] 被称为 #cf_span[k]-主导的，当且仅当 #cf_span[s] 的每个长度至少为 #cf_span[k] 的子串都包含该字符 #cf_span[c]。\n\n你需要找到最小的 #cf_span[k]，使得存在至少一个 #cf_span[k]-主导的字符。\n\n第一行包含一个由小写拉丁字母组成的字符串 #cf_span[s]（#cf_span[1 ≤ |s| ≤ 100000]）。\n\n请输出一个数字——存在至少一个 #cf_span[k]-主导字符的最小 #cf_span[k] 值。"},{"iden":"input","content":"第一行包含一个由小写拉丁字母组成的字符串 #cf_span[s]（#cf_span[1 ≤ |s| ≤ 100000]）。"},{"iden":"output","content":"请输出一个数字——存在至少一个 #cf_span[k]-主导字符的最小 #cf_span[k] 值。"},{"iden":"examples","content":"输入\nabacaba\n输出\n2\n输入\nzzzzz\n输出\n1\n输入\nabcde\n输出\n3"}],"sample_group":[],"show_order":[],"formal_statement":"Let $ s $ be a string of length $ n \\geq 1 $ over the alphabet $ \\Sigma = \\{a, b, \\dots, z\\} $.\n\nFor a character $ c \\in \\Sigma $ and an integer $ k \\geq 1 $, define $ c $ to be **$ k $-dominant** if every contiguous substring of $ s $ of length $ \\geq k $ contains at least one occurrence of $ c $.\n\nDefine the set:\n$$\nK = \\left\\{ k \\in \\mathbb{Z}^+ \\mid \\exists\\, c \\in \\Sigma \\text{ such that } c \\text{ is } k\\text{-dominant} \\right\\}\n$$\n\nFind:\n$$\n\\min K\n$$","simple_statement":null,"has_page_source":false}