#include <bits/stdc++.h>
using namespace std;
int n, a, x, m, z = 1, ans;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> m;
  cin >> x;
  a = x;
  for (int i = 2; i <= n; i++) {
    cin >> x;
    if (a != x) {
      z++;
    } else {
      ans = max(z, ans);
      z = 1;
    }
    a = x;
  }
  ans = max(z, ans);
  cout << ans;
  return 0;
}
