#include <bits/stdc++.h>
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  int a[n];
  int res = 0;
  for (int i = 1, len; i <= n; i++) {
    scanf("%d", &a[i]);
    if (i == 1 || a[i] == a[i - 1])
      len = 1;
    else
      len++;
    if (len > res) {
      res = len;
    } else {
      res = res;
    }
  }
  printf("%d", res);
  return 0;
}
