{"raw_statement":[{"iden":"problem statement","content":"You are given a string $S$ consisting of `0` and `1`. Find the maximum integer $K$ not greater than $|S|$ such that we can turn all the characters of $S$ into `0` by repeating the following operation some number of times.\n\n*   Choose a contiguous segment $[l,r]$ in $S$ whose length is at least $K$ (that is, $r-l+1\\geq K$ must be satisfied). For each integer $i$ such that $l\\leq i\\leq r$, do the following: if $S_i$ is `0`, replace it with `1`; if $S_i$ is `1`, replace it with `0`."},{"iden":"constraints","content":"*   $1\\leq |S|\\leq 10^5$\n*   $S_i(1\\leq i\\leq N)$ is either `0` or `1`."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$S$"},{"iden":"sample input 1","content":"010"},{"iden":"sample output 1","content":"2\n\nWe can turn all the characters of $S$ into `0` by the following operations:\n\n*   Perform the operation on the segment $S[1,3]$ with length $3$. $S$ is now `101`.\n*   Perform the operation on the segment $S[1,2]$ with length $2$. $S$ is now `011`.\n*   Perform the operation on the segment $S[2,3]$ with length $2$. $S$ is now `000`."},{"iden":"sample input 2","content":"100000000"},{"iden":"sample output 2","content":"8"},{"iden":"sample input 3","content":"00001111"},{"iden":"sample output 3","content":"4"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}