#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, k;
  cin >> n >> k;
  int m = 0, c = 1, p, a;
  cin >> p;
  n--;
  while (n--) {
    cin >> a;
    if (a != p)
      c++;
    else {
      if (c > m) m = c;
      c = 1;
    }
    p = a;
  }
  if (c > m) m = c;
  cout << m << endl;
  return 0;
}
