Start: 2023-09-17 08:00:00

0917日常周赛

End: 2023-09-24 00:00:00
Now  2026-03-21 09:32:07  类型: IOI  状态: Ended 

P2. Vacation Together
Description

There are N people numbered 11 to N.
You are given their schedule for the following D days. The schedule for person i is represented by a string ��Si of length D. If the j-th character of ��Si is o, person i is free on the j-th day; if it is x, they are occupied that day.

From these D days, consider choosing some consecutive days when all the people are free.
How many days can be chosen at most? If no day can be chosen, report 00.


Input

The input is given from Standard Input in the following format:

N

s1

s2

...

sN

Output

Print the maximum number of days that can be chosen, or 0 if no day can be chosen.


Examples

Input

3 5
xooox
oooxx
oooxo

Output

2

Input

3 3
oxo
oxo
oxo

Output

1

Input

3 3
oox
oxo
xoo

Output

0
Hint
  • 1N100

  • 1≤�≤1001D100

  • N and D are integers.

  • ��Si is a string of length D consisting of o and x.


first

All the people are free on the second and third days, so we can choose them.
Choosing these two days will maximize the number of days among all possible choices.

second

Note that the chosen days must be consecutive. (All the people are free on the first and third days, so we can choose either of them, but not both.)

input4

1 7
ooooooo

output4

7

input5

5 15

5 15
oxooooooooooooo
oxooxooooooooox
oxoooooooooooox
oxxxooooooxooox
oxooooooooxooox

output5

5





Submit

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