#include <bits/stdc++.h>
using namespace std;
int a[100006];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, k;
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> a[i];
  int i = 1;
  int ans = 1;
  while (i <= n) {
    int j = i;
    while (i + 1 <= n && a[i] != a[i + 1]) i++;
    ans = max(ans, i - j + 1);
    i++;
  }
  cout << ans << endl;
}
