CF1082B Vova and Trophies

Description

Vova has won $ n $ trophies in different competitions. Each trophy is either golden or silver. The trophies are arranged in a row. The beauty of the arrangement is the length of the longest subsegment consisting of golden trophies. Vova wants to swap two trophies (not necessarily adjacent ones) to make the arrangement as beautiful as possible — that means, to maximize the length of the longest such subsegment. Help Vova! Tell him the maximum possible beauty of the arrangement if he is allowed to do at most one swap.

Input Format

N/A

Output Format

N/A

Explanation/Hint

In the first example Vova has to swap trophies with indices $ 4 $ and $ 10 $ . Thus he will obtain the sequence "GGGGGGGSGS", the length of the longest subsegment of golden trophies is $ 7 $ . In the second example Vova can make no swaps at all. The length of the longest subsegment of golden trophies in the sequence is $ 4 $ . In the third example Vova cannot do anything to make the length of the longest subsegment of golden trophies in the sequence greater than $ 0 $ .