#include <bits/stdc++.h>
using namespace std;
const int INF = 1000 * 1007;
const int MOD = 1e9 + 7;
const int MAXN = 100100;
char ans[MAXN], s[MAXN];
int main() {
  ios_base::sync_with_stdio(false);
  long long n, m;
  cin >> n >> m;
  long long a[n], ans = INT_MIN, c;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    if (i == 0 || (a[i] == a[i - 1])) {
      c = 1;
    } else {
      c++;
    }
    ans = max(ans, c);
  }
  cout << ans;
  return 0;
}
