#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
int a[maxn];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) cin >> a[i];
  int cnt = 1, ans = 1;
  for (int i = 2; i <= n; i++) {
    if (a[i] != a[i - 1]) {
      cnt++;
      ans = max(ans, cnt);
    } else {
      cnt = 1;
    }
  }
  cout << ans << endl;
}
