Start: 2025-07-31 20:40:00

暑假训练赛17订正

End: 2025-08-09 00:00:00
Now  2026-01-16 23:30:58  类型: IOI  状态: Ended 

P1. 01 字符串str
Description

给你一个只包含字符0和字符1的字符串,允许你最多做一次如下的变换操作(最多一次说明你可以选择不做,但是最多只能进行一次操作)。  

你可以选择一个位置 x,1 \leq x \lt n ,把字符串 s_1, s_2, s_3, ..., s_n 变成 s_{x+1}, ..., s_n, s_1, s_2, s_3, ..., s_x 。  

最终问你最多一次操作后s字符串中连续的全1子串最长是多少?


Input

一行一个01字符串。

Output

输出题目要求的答案。

Examples

Input

1001

Output

2

Input

11111

Output

5

Input

10111010

Output

3
Hint

- 对于40%的数据, 1 \leq |s| \leq 100

- 对于100%的数据, 1 \leq |s| \leq 10^5 。  

其中 |s| 表示字符串s的长度。


Submit

题目参数
Time Limit 1 second
Memory Limit 128 MB
Submit