Crazy Binary String
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

ZYB loves binary strings (strings that only contains `0' and `1'). And he loves more, where the number of `0' and the number of `1' in the string are equal.

ZYB wants to choose a substring from an original string  so that it is an with the longest length possible. He also wants to choose a subsequence of which meets the same requirements.

A string is a substring of a string if is empty, or there are two integers and  such that . A string is a subsequence of a string   if it can be derived from   by deleting any number (including zero) of characters without changing the order of the remaining characters. 

For simplicity, you only need to output the maximum possible length. Note that the empty string is both a substring and a subsequence of any string.

输入描述:

The first line of the input contains a single integer , the length of the original string . The second line contains a binary string with exactly  characters, the original string .

输出描述:

Print two integers  and , denoting the answer for substring and subsequence respectively.
示例1

输入

复制
8
01001001

输出

复制
4 6