{"raw_statement":[{"iden":"statement","content":"Is there anything better than going to the zoo after a tiresome week at work? No wonder Grisha feels the same while spending the entire weekend accompanied by pretty striped zebras.\n\nInspired by this adventure and an accidentally found plasticine pack (represented as a sequence of black and white stripes), Grisha now wants to select several consequent (contiguous) pieces of alternating colors to create a zebra. Let's call the number of selected pieces the length of the zebra.\n\nBefore assembling the zebra Grisha can make the following operation $0$ or more times. He splits the sequence in some place into two parts, then reverses each of them and sticks them together again. For example, if Grisha has pieces in the order \"_bwbbw_\" (here '_b_' denotes a black strip, and '_w_' denotes a white strip), then he can split the sequence as _bw|bbw_ (here the vertical bar represents the cut), reverse both parts and obtain \"_wbwbb_\".\n\nDetermine the maximum possible length of the zebra that Grisha can produce."},{"iden":"input","content":"The only line contains a string $s$ ($1 \\le |s| \\le 10^5$, where $|s|$ denotes the length of the string $s$) comprised of lowercase English letters '_b_' and '_w_' only, where '_w_' denotes a white piece and '_b_' denotes a black piece."},{"iden":"output","content":"Print a single integer — the maximum possible zebra length."},{"iden":"examples","content":"Input\n\nbwwwbwwbw\n\nOutput\n\n5\n\nInput\n\nbwwbwwb\n\nOutput\n\n3"},{"iden":"note","content":"In the first example one of the possible sequence of operations is _bwwwbww|bw_ $\\to$ _w|wbwwwbwb_ $\\to$ _**wbwbw**wwbw_, that gives the answer equal to $5$.\n\nIn the second example no operation can increase the answer."}],"translated_statement":[{"iden":"statement","content":"在工作了一周疲惫之后，还有什么比去动物园更好的事呢？格里沙在整个周末都伴随着漂亮的条纹斑马度过，自然也有同样的感受。\n\n受这次冒险的启发，以及偶然发现的一包橡皮泥（表示为一系列黑白条纹），格里沙现在想选择若干连续的交替颜色的片段来制作一条斑马。我们称所选片段的数量为斑马的长度。\n\n在组装斑马之前，格里沙可以执行以下操作 0 次或多次：他将序列在某处切分为两部分，然后分别反转这两部分，再将它们重新拼接在一起。例如，如果格里沙的片段顺序为 \"_bwbbw_\"（这里 '_b_' 表示黑色条纹，'_w_' 表示白色条纹），他可以将序列切分为 _bw|bbw_（此处竖线表示切割点），反转两部分后得到 \"_wbwbb_\"。\n\n请确定格里沙能制作出的斑马的最大可能长度。\n\n输入仅有一行，包含一个字符串 $s$（$1 lt.eq | s | lt.eq 10^5$，其中 $| s |$ 表示字符串 $s$ 的长度），该字符串仅由小写英文字母 '_b_' 和 '_w_' 组成，其中 '_w_' 表示白色片段，'_b_' 表示黑色片段。\n\n请输出一个整数——斑马的最大可能长度。\n\n在第一个示例中，一种可能的操作序列是 _bwwwbww|bw_ $arrow.r$ _w|wbwwwbwb_ $arrow.r$ _*wbwbw*wwbw_，得到的答案为 $5$。\n\n在第二个示例中，任何操作都无法增加答案。"},{"iden":"input","content":"The only line contains a string $s$ ($1 lt.eq | s | lt.eq 10^5$, where $| s |$ denotes the length of the string $s$) comprised of lowercase English letters '_b_' and '_w_' only, where '_w_' denotes a white piece and '_b_' denotes a black piece."},{"iden":"output","content":"Print a single integer — the maximum possible zebra length."},{"iden":"examples","content":"InputbwwwbwwbwOutput5InputbwwbwwbOutput3"},{"iden":"note","content":"In the first example one of the possible sequence of operations is _bwwwbww|bw_ $arrow.r$ _w|wbwwwbwb_ $arrow.r$ _*wbwbw*wwbw_, that gives the answer equal to $5$.In the second example no operation can increase the answer."}],"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ s \\in \\{b, w\\}^n $ be a string of length $ n $, where $ n \\in \\mathbb{Z} $, $ 1 \\leq n \\leq 10^5 $.  \n\nA *zebra* is a contiguous substring of $ s $ in which no two adjacent characters are equal (i.e., alternating $ b $ and $ w $).  \n\nAn *operation* consists of:  \n- Choosing an index $ k \\in \\{0, 1, \\dots, n\\} $ to split $ s $ into two parts: $ s[0:k] $ and $ s[k:n] $,  \n- Reversing each part independently,  \n- Concatenating them: $ \\text{reverse}(s[0:k]) + \\text{reverse}(s[k:n]) $.  \n\nThis operation may be performed any number of times (including zero).  \n\n**Constraints**  \n- $ s $ contains only characters 'b' and 'w'.  \n\n**Objective**  \nDetermine the maximum possible length of a zebra (alternating contiguous substring) obtainable after any number of operations.","simple_statement":null,"has_page_source":false}