#include <bits/stdc++.h>
using namespace std;
const long long int maxn = 1e5 + 4;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, k;
  cin >> n >> k;
  long long int a[n + 2];
  for (long long int i = 0; i < n; i++) cin >> a[i];
  long long int temp = 0, count = 0;
  for (long long int i = 1; i < n; i++) {
    if (a[i] != a[i - 1])
      temp++, count = max(temp, count);
    else
      temp = 0;
    count = max(temp, count);
  }
  cout << count + 1 << endl;
  return 0;
}
