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