#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k;
  cin >> n >> k;
  long long arr[n];
  for (int i = 0; i < (n); ++i) {
    cin >> arr[i];
  }
  long long ans[n];
  ans[0] = 1;
  for (int i = 1; i <= (n - 1); ++i) {
    if (arr[i - 1] != arr[i])
      ans[i] = ans[i - 1] + 1;
    else
      ans[i] = 1;
  }
  sort(ans, ans + n);
  cout << ans[n - 1];
  return 0;
}
