#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  int ans = 0, len = 0, pre = 0;
  while (n--) {
    int a;
    cin >> a;
    if (a == pre) len = 0;
    len++;
    ans = max(ans, len);
    pre = a;
  }
  cout << ans << '\n';
  return 0;
}
