#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k, a[100005], i, max = -1, c;
  cin >> n >> k >> a[0];
  c = 1;
  for (i = 1; i < n; i++) {
    cin >> a[i];
    if (a[i] != a[i - 1]) c++;
    if (a[i] == a[i - 1] || i == n - 1) {
      if (c > max) max = c;
      c = 1;
    }
  }
  if (c > max) max = c;
  cout << max << endl;
  return 0;
}
