#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, cnt = 1, max = 1, x, c;
  cin >> n >> k;
  cin >> c;
  n--;
  while (n != 0) {
    cin >> x;
    if (x != c)
      cnt++;
    else {
      if (max < cnt) max = cnt;
      cnt = 1;
    }
    c = x;
    n--;
  }
  if (cnt > max) max = cnt;
  cout << max;
}
