There are $n$ houses along the road where Anya lives, each one is painted in one of $k$ possible colors.

Anya likes walking along this road, but she doesn't like when two adjacent houses at the road have the same color. She wants to select a long segment of the road such that no two adjacent houses have the same color.

Help Anya find the longest segment with this property.


-----Input-----

The first line contains two integers $n$ and $k$ — the number of houses and the number of colors ($1 \le n \le 100\,000$, $1 \le k \le 100\,000$).

The next line contains $n$ integers $a_1, a_2, \ldots, a_n$ — the colors of the houses along the road ($1 \le a_i \le k$).


-----Output-----

Output a single integer — the maximum number of houses on the road segment having no two adjacent houses of the same color.


-----Example-----
Input
8 3
1 2 3 3 2 1 2 2

Output
4



-----Note-----

In the example, the longest segment without neighboring houses of the same color is from the house 4 to the house 7. The colors of the houses are $[3, 2, 1, 2]$ and its length is 4 houses.

Difficulty: interview

Starter code:

Solutions:
n,k = list(map(int, input().split()))
a=list(map(int, input().split()))

last=''
m = 0
s=0
for i in a:
    if i==last:
        s=1
    else:
        s+=1
    last=i
    if s>m:
        m=s
print(m)


def ii():
    return int(input())
def mi():
    return list(map(int, input().split()))
def li():
    return list(mi())

# M. The Pleasant Walk
n, k = mi()
a = li()
c = p = 0
ans = 1
for ai in a:
    if ai == p:
        c = 1
    else:
        c += 1
        ans = max(ans, c)
    p = ai
print(ans)


n,k=list(map(int,input().split()))
a=list(map(int,input().split()))
mx=0
temp=1
for i in range (1,n):
    if(a[i]!=a[i-1]):
        temp+=1
    else:
        if(temp>mx):
            mx=temp
        temp=1
print(max(temp,mx))


n , m = list(map(int ,input().split()))
a = list(map(int,input().split()))
st = 0
end = 0
res = 1
for i in range(1,n):
    if a[i]!= a[i-1]:
        end+=1
    else:
        res = max(res,end-st+1)
        st = i
        end = i
if end==n-1:
    res = max(res,end-st+1)
print(res)



n,m=map(int,input().split())
listik=list(map(int,input().split()))
counter=1
maxs=0
for i in range(n-1):
    if listik[i]!=listik[i+1]:
        counter+=1
    else:
        maxs=max(maxs,counter)
        counter=1
maxs=max(counter,maxs)  
print(maxs)

n,k=map(int,input().split())
a=list(map(int,input().split()))
mx=1
ct=1
for i in range(1,n):
    if a[i]!=a[i-1]:
        ct+=1
    mx=max(mx,ct)
    if a[i]==a[i-1]:
        ct=1
print(mx)        

n, k = list(map(int, input().strip().split()))
colors = list(map(int, input().strip().split()))

l = 0
previ = -1
for i in range(n-1):
    if colors[i] == colors[i+1]:
        cl = i - previ
        if cl > l:
            l = cl
        previ = i

if previ == -1:
    l = n
else:
    cl = (n-1) - previ
    if cl > l:
        l = cl

print(l)

'''input
8 3
1 2 3 3 2 1 2 2
'''
n,k = list(map(int, input().split()))
a = list(map(int, input().split()))
ans = 0
i = 1
if (n==1):
	print(1)
else:	
	while i<n:
		t=1
		while(i<n and a[i] != a[i-1]):
			t += 1
			i += 1
		i += 1
		ans = max(ans, t)
	print(ans)

t,m = map(int,input().split())
arr = list(map(int,input().split()))

counter = 0
cache = 0
maxi = 0
for i in range(t):
	if(i==0):
		
		cache = arr[i]
		counter = counter+1
	else:
		if(cache!=arr[i]):
			counter= counter+1
			cache = arr[i]
			
		else:
			counter=1
	if(maxi<counter):
				maxi=counter

print(maxi)

n, k = list(map(int, input().split()))
x = list(map(int, input().split()))

l = r = ln = 0

while r < n:
	if r > 0 and x[r] == x[r-1]:
		l = r
	ln = max(ln, r-l+1)
	r += 1

print(ln)


n=input().split( )
n[0]=int(n[0])
a=input().split( )
for i in range(n[0]):
    a[i]=int(a[i])
j=[]
c=1
if n[0]==1:
    print(1)
else:
    for i in range(n[0]-1):
        if i+1==n[0]-1 and a[i]!=a[i+1]:
            c+=1
            j.append(c)
        elif a[i]!=a[i+1]:
            c+=1
        else:
            j.append(c)
            c=1
    t=max(j)
    print(t)


n,k=map(int,input().split())
a=list(map(int,input().split()))
ans=0
count=0
for i in range(1,n):
    if a[i]!=a[i-1]:
        count+=1
    if count>ans:
        ans=count
    if a[i]==a[i-1]:
        count=0
print(ans+1)

n, k = list(map(int, input().split()))
A = list(map(int, input().split()))
answer = 0
x = 1
for i in range(1, n):
    if A[i] != A[i - 1]:
        x += 1
    else:
        if x > answer:
            answer = x
        x = 1
if x > answer:
    answer = x
print(answer)


n,k=map(int,input().split())
a=list(map(int,input().split()))
d=a[0]
s=1
m=1

for i in range(1,n):
	if d!=a[i]:
		s+=1
	else:
		s=1
	d=a[i]
	if s>m:
		m=s
	# print(s,a[i])
print(m)

n, k = map(int, input().split())
l = [*map(int, input().split())]
curr = res = 0
for i, e in enumerate(l):
    if i != 0 and l[i] == l[i - 1]:
        curr = i
    res = max(res, i - curr + 1)
print(res)

n, m = list(map(int,input().split()))
a = list(map(int,input().split()))
b = []
count = 0


for i in range(len(a)-1):
    if a[i] != a[i+1]:
        count+=1
        b.append(count)
    else:
        count = 0
        b.append(count)


#print(b)
if len(b) == 0:
    print(n)
#elif max(b) == 0:
    #print(0)
else:
    print(max(b) + 1)


dom_color = [int(x) for x in input().split(' ')]
dom = [int(x) for x in input().split(' ')]
max1 = 1; max2 = 1
for i in range(dom_color[0]-1):
    if dom[i] != dom[i+1]:
        max2+=1
    if dom[i] == dom[i+1]:
        if max2>max1:
            max1 = max2
        max2 = 1
if max2>max1:
    max1 = max2
print(max1)


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

counter = 0
r = []
pred = a[0]
for i in range(1, n):
    if a[i] != pred:
        counter += 1
    else:
        r.append(counter+1)
        counter = 0
    pred = a[i]
if counter != 0:
    r.append(counter+1)

if r != []:
    print(max(r))
else:
    print(1)


n, k = list(map(int, input().split()))
line = [int(x) for x in input().split(' ')]
line.append(line[-1])
maxs = []

last = line[0]
count = 1
for i in range(1, n+1):
    if line[i] != last:
        count += 1
    else:
        maxs.append(count)
        count = 1
    last = line[i]

if maxs == []:
    print(1)
else:
    print(max(maxs))


n, k = map(int, input().split(' '))
a = list(map(int, input().split(' ')))
m = 0
temp = 1
if len(a) > 1:
    for i in range(1, n):
        if a[i] == a[i - 1]:
            temp = 1
        else:
            temp += 1

        if temp > m:
            m = temp
else:
    m = 1

print(m)

n, k = list(map(int, input().split()))
c = list(map(int, input().split()))
m = 1
z = 0
e = 0
while e < n:
    while e + 1 < n and c[e] != c[e + 1]:
        e += 1
    m = max(m, e - z + 1)
    while e + 1 < n and c[e] == c[e + 1]:
        e += 1
    z = e
    e += 1
print(m)


n, k = map(int, input().split())
L = list(map(int, input().split()))
label = 0
ans = 1
for i in range(1, n):
    if L[i] == L[i - 1]:
        label = i
    cur = i - label + 1
    if cur > ans:
            ans = cur
print(ans)        

n, k = list(map(int, input().split()))
Max = 0
m = 1
H = list(map(int, input().split()))
for i in range(n - 1):
    if H[i] != H[i + 1]:
        m += 1
    else:
        if m > Max:
            Max = m
        m = 1
if m > Max:
    Max = m
print(Max)


en = list(map(int, input().split()))
n = en[0]
k = en[1]

houses = list(map(int, input().split()))

segments = []
counter = 1
for i in range(1, n):
	if(houses[i] != houses[i-1]):
		counter+=1
	else:
		segments.append(counter)
		counter=1

segments.append(counter)
print(max(segments))

n, k = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
count = 1
p = a[0]
num = 0
if n == 1:
    print(1)
else:
    for i in a[1:]:
        if i != p:
            p = i
            count += 1
        else:
            if num < count:
                num = count
            count = 1
    else:
        if num < count:
            num = count
    print(num)