#include <bits/stdc++.h>
using namespace std;
const int N = 0;
int n, k, x;
string s;
vector<int> v;
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 0; i < n; i++) {
    scanf("%d", &x);
    v.push_back(x);
  }
  int cnt = 1;
  int mx = 1;
  for (int i = 1; i < n; i++) {
    if (v[i] == v[i - 1]) {
      mx = max(cnt, mx);
      cnt = 1;
      continue;
    }
    cnt++;
    mx = max(cnt, mx);
  }
  printf("%d\n", mx);
  return 0;
}
