Arya has n opponents in the school. Each day he will fight with all opponents who are present this day. His opponents have some fighting plan that guarantees they will win, but implementing this plan requires presence of them all. That means if one day at least one of Arya's opponents is absent at the school, then Arya will beat all present opponents. Otherwise, if all opponents are present, then they will beat Arya.

For each opponent Arya knows his schedule — whether or not he is going to present on each particular day. Tell him the maximum number of consecutive days that he will beat all present opponents.

Note, that if some day there are no opponents present, Arya still considers he beats all the present opponents.


-----Input-----

The first line of the input contains two integers n and d (1 ≤ n, d ≤ 100) — the number of opponents and the number of days, respectively.

The i-th of the following d lines contains a string of length n consisting of characters '0' and '1'. The j-th character of this string is '0' if the j-th opponent is going to be absent on the i-th day.


-----Output-----

Print the only integer — the maximum number of consecutive days that Arya will beat all present opponents.


-----Examples-----
Input
2 2
10
00

Output
2

Input
4 1
0100

Output
1

Input
4 5
1101
1111
0110
1011
1111

Output
2



-----Note-----

In the first and the second samples, Arya will beat all present opponents each of the d days.

In the third sample, Arya will beat his opponents on days 1, 3 and 4 and his opponents will beat him on days 2 and 5. Thus, the maximum number of consecutive winning days is 2, which happens on days 3 and 4.

Difficulty: interview

Starter code:

Solutions:
n,d = map(int,input().split())

ans = 0
has = 0
for i in range(d):
    s = input().count("1")
    if s==n:
        has = 0
    else:
        has+=1
    ans = max(ans,has)
print(ans)

n, d = list(map(int, input().split()))
c = [input() for _ in range(d)]
r = 0
x = 0
for v in c:
    if "0" in v:
        x += 1
        r = max(r, x)
    else:
        x = 0
print(r)


n, d = list(map(int, input().split()))
check = "1"*n
ans = 0
cur = 0
for i in range(d):
    s = input()
    if s != check:
        cur += 1
        ans = max(ans, cur)
    else:
        cur = 0
print(ans)


n,d=map(int,input().split())
streak=0
maximum=0
for day in range(d):
    c=input()
    
    if c!="1"*n:
        streak+=1
        maximum=max(maximum,streak)
    else:
        streak=0

print(maximum)

read = lambda: list(map(int, input().split()))
n, d = read()
a = [list(map(int, input())) for i in range(d)]
ans = 0
d = 0
for i in a:
    if sum(i) < n: d += 1
    else:
        ans = max(ans, d)
        d = 0
ans = max(ans, d)
print(ans)


n,d = [int(x) for x in input().split(' ')]

m,c=0,0

for i in range(d):
	k = input()
	if k.count('1') == n:
		m = max(m,c)
		c = 0
		continue
	else:
		c += 1
	
m = max(m,c)
print(m)

n, d = map(int, input().split())
a = []
for i in range(d):
    a.append(input())

cur = 0
mx = 0
for i in range(d):
    ok = True
    for j in range(n):
        if a[i][j] == '0':
            ok = False
            break

    if not ok:
        cur += 1
        mx = max(mx, cur)
    else:
        cur = 0

print(mx)

n, d = map(int, input().split())
result = 0
cur = 0

for i in range(d):
    if '0' in input():
        cur += 1
    else:
        cur = 0
    result = max(result, cur)


print(result)

from sys import stdin, stdout
e, n = map(int, stdin.readline().split())
cnt = 0
ans = 0
for i in range(n):
    s = stdin.readline().rstrip()
    if s.count('1') != e:
        cnt += 1
    else:
        cnt = 0
    ans = max(ans, cnt)
stdout.write(str(ans))

n, d = map(int, input().split())

days = 0
max_days = 0
for i in range(d):
    if '0' in input():
        days += 1
        max_days = max(days, max_days)
    else:
        days = 0
print(max_days)

n, d = list(map(int, input().split()))

max_stroke = 0
current_stroke = 0

for i in range(d):
    schedule = input()
    if '0' in schedule:
        current_stroke += 1
        if current_stroke > max_stroke:
            max_stroke = current_stroke
    else:
        current_stroke = 0

print(max_stroke)


import sys
n,d = map(int,input().split())
count = 0
mx = 0
for i in range(d):
    s = input()
    if s == ('1'*n):
        mx = max(mx,count)
        count = 0
    else:
        count += 1
print(max(mx,count))

n,d = list(map(int,input().split()))
ans = 0
temp = 0
for i in range(d):
    ai = input()
    temp2 = 0
    for j in ai:
        if j == "0":
            temp += 1
            temp2 = 1
            break
    if temp2 == 0:
        temp = 0
    if temp > ans:
        ans = temp
print(ans)
    


n, d = map(int, input().split())

current_max = 0
answer = 0

for i in range(d):
    s = list(str(input()))

    if s.count('1') != n:
        current_max += 1
    else:
        answer = max(current_max, answer)
        current_max = 0

answer = max(current_max, answer)
print(answer)

import sys, math
#n=int(input())
n,m=map(int,input().split())
z=[0]*m
for i in range(m):
    s=input()
    if '0' in s:
        z[i]=1
z.append(0)
max_=0
now=0
for i in range(m+1):
    if z[i]==0:
        max_=max(max_,now)
        now=0
    else:
        now+=1
print(max_)

n, d = [int(x) for x in input().split()]
max_vic = 0
vic = 0
test = '1'*n
for i in range(d):
    if input() == test:
        max_vic = max(vic, max_vic)
        vic = 0
    else:
        vic += 1
max_vic = max(vic, max_vic)
print(max_vic)




n,d = list(map(int, input().split()))

consecutiveDays = 0

currentMax = 0
for item in range(d):
    current = input()
    if '0' in current:
        currentMax += 1
        consecutiveDays = max(consecutiveDays, currentMax)
    else:
        currentMax = 0

print(consecutiveDays)


n,d=map(int,input().split())
ch=[]
c_ch=0
for i in range(d):
    a=input()
    if '0' in a:
        c_ch+=1
    else:
        ch.append(c_ch)
        c_ch=0
ch.append(c_ch)
print(max(ch))

n, d = map(int, input().split())
c = 0
maxc = 0
while d > 0:
    x = input()
    if x.count('1') == len(x):
        maxc = max(maxc, c)
        c = 0
    else:
        c += 1
    d -= 1
maxc = max(maxc, c)
print(maxc)


n, d = list(map(int, input().split()))

result, current = 0, 0

for _ in range(d):
    tmp = input()
    if any([x != '1' for x in tmp]):
        current += 1
    else:
        result = max([result, current])
        current = 0

result = max([result, current])
print(result)


n, d = list(map(int, input().split()))
best, cur = 0, 0
for i in range(d):
    day = list(set(input()))
    if day != ['1']:
        cur += 1
    else:
        cur = 0
    best = max(best, cur)
print(best)
        


n, d = list(map(int, input().split()))

max = 0
seq = 0

for i in range(d):
    if '0' in set(input()):
        seq += 1
    else:
        if seq > max:
            max = seq
        seq = 0

if seq > max:
    max = seq

print(max)


n,d = map(int,input().split())
arr = []
for i in range(d):
    arr.append(input())

def check(s):
    fail = 0
    for x in s:
        if(x=='0'):
            fail = 1
    return fail

pres = 0
max = 0
for x in arr:
    if(check(x)):
        pres += 1
    else:
        if(max<pres):
            max = pres
        pres = 0
if(max<pres):
    max = pres
print(max)

n, d = [int(x) for x in input().split()]

L = [0]*(d+1)
for i in range(d):
    X = input()
    if '0' in X:
        L[i] = 1+L[i-1]
    else:
        L[i] = 0
print(max(L))
    


n, d = list(map(int, input().strip().split()))
res = 0
cur = 0
for _ in range(d):
    if n == input().strip().count('1'):
        res = max(res, cur)
        cur = 0
    else:
        cur += 1
print(max(res, cur))