#include <bits/stdc++.h>
using namespace std;
int a[100010];
inline int read() {
  char c = getchar();
  int x = 0, flag = 1;
  while (!isdigit(c)) {
    if (c == '-') flag = -1;
    c = getchar();
  }
  while (isdigit(c)) x = x * 10 + c - '0', c = getchar();
  return x * flag;
}
int main() {
  int n = read(), k = read(), lst = 1, ans = 0;
  for (int i = 1; i <= n; i++) {
    a[i] = read();
    if (a[i] == a[i - 1]) lst = i;
    ans = max(ans, i - lst + 1);
  }
  cout << ans;
  return 0;
}
