#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  int f;
  cin >> f;
  n--;
  int dem = 1, maxi = 1;
  while (n--) {
    int in;
    cin >> in;
    if (f != in) {
      dem++;
    } else {
      dem = 1;
    }
    if (dem > maxi) {
      maxi = dem;
    }
    f = in;
  }
  cout << maxi;
  return 0;
}
