#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, m, l{0};
  vector<int> a;
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> m;
    a.push_back(m);
  }
  m = 1;
  for (int i = 0; i < n; i++) {
    if (i == 0)
      l++;
    else {
      if (a[i] != a[i - 1])
        l++;
      else if (l > m) {
        m = l;
        l = 1;
      } else {
        l = 1;
      }
    }
    if (l > m) m = l;
  }
  cout << m;
}
