#include <bits/stdc++.h>
using namespace std;
int N, i, j, k, A[500001], ans = 0;
int main() {
  scanf("%d", &N);
  for (int l = 0; l < N; l++) scanf("%d", &A[l]);
  i = 1;
  while (i < N - 1) {
    j = k = i;
    while (j < N - 1 && A[j] != A[j - 1] && A[j] != A[j + 1]) j++;
    if (!((j - i) & 1))
      while (k < i + (j - i) / 2) A[k++] = A[i - 1];
    while (k < j) A[k++] = A[j];
    ans = max(ans, (int)ceil((j - i) / 2.0));
    i = j + 1;
  }
  printf("%d\n", ans);
  for (int i = 0; i < N; i++) printf("%d ", A[i]);
  printf("\n");
}
