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