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