#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
const long long mod = 1e9 + 7;
const long long inf = 1e9 + 7;
int main() {
  long long n, k;
  cin >> n >> k;
  vector<long long> v(n);
  long long s = 0, cur = 0;
  for (int i = 0; i < n; ++i) {
    cin >> v[i];
    if (i == 0 || (i > 0 && v[i] == v[i - 1])) {
      s = max(s, cur);
      cur = 0;
    }
    cur++;
  }
  cout << max(s, cur);
  return 0;
}
