#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, k, counterMaxi = -1e9, tempCounter = 0;
  cin >> n >> k;
  int inputs[2] = {-1};
  for (int i = 0; i < n; i++) {
    cin >> inputs[1];
    if (inputs[0] == inputs[1]) {
      counterMaxi = max(counterMaxi, tempCounter);
      tempCounter = 1;
    } else
      tempCounter++;
    inputs[0] = inputs[1];
  }
  cout << max(counterMaxi, tempCounter);
  return 0;
}
