#include <bits/stdc++.h>
using namespace std;
const int N = 1e6;
long long int n, k, mx, sum, a[N];
int main() {
  cin >> n >> k;
  sum++;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (i) {
      if (a[i] != a[i - 1]) {
        sum++;
        mx = max(mx, sum);
      } else {
        sum = 1;
      }
    }
  }
  mx = max(sum, mx);
  cout << mx;
  return 0;
}
