#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vb = vector<bool>;
using vs = vector<string>;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  int N, K;
  cin >> N >> K;
  int str = 0, ans = 0;
  vi col(N);
  for (int i = 0; i < N; i++) {
    cin >> col[i];
    if (i > 0 && col[i] == col[i - 1]) {
      str = 1;
    } else {
      str++;
    }
    ans = max(ans, str);
  }
  cout << ans << endl;
  return 0;
}
