#include <bits/stdc++.h>
const long long INF = 1e9 + 7;
const int maxn = 1e5 + 3;
using namespace std;
int n, k, a[maxn], f[maxn], res;
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    if (a[i] != a[i - 1])
      f[i] = f[i - 1] + 1;
    else
      f[i] = 1;
    res = max(res, f[i]);
  }
  printf("%d", res);
}
