#include <bits/stdc++.h>
using namespace std;
int a[100000];
int main() {
  int n, k;
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> a[i];
  int max_ending_so_far = 1;
  int max_so_far = 1;
  for (int i = 1; i < n; i++) {
    if (a[i] == a[i - 1])
      max_ending_so_far = 1;
    else
      max_ending_so_far += 1;
    if (max_ending_so_far > max_so_far) max_so_far = max_ending_so_far;
  }
  cout << max_so_far << endl;
  return 0;
}
