import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines N,*A = map(int,read().split()) dp = 0,0 # 最後をとらない、とる prev = -1 for x in A: if x == prev: dp = max(dp), max(dp) + 1 else: dp = max(dp), dp[0] + 1 prev = x answer = max(dp) print(answer)