#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, z, c, temp, high = 0, hasil = 0;
  cin >> n >> z;
  int i = 0;
  do {
    cin >> c;
    if (c == temp) {
      hasil = 1;
    } else {
      hasil++;
    }
    if (hasil > high) {
      high = hasil;
    }
    i++;
    temp = c;
  } while (i < n);
  cout << high;
  return 0;
}
