#include <bits/stdc++.h>
int main() {
  int n, s = 0, M = 0, i = 1, j, p, u, x;
  scanf("%d", &n);
  int R[n + 1];
  scanf("%d", R);
  for (p = R[0]; scanf("%d", &x), i <= n; R[i++] = p = x) {
    if (i == n) x = p;
    if (x == p) {
      u = i - s - 2;
      M = std::max(M, (u + 1) / 2);
      for (j = 0; j < u; ++j) R[s + j + 1] = j < u / 2 ? R[s] : x;
      s = i;
    }
  }
  printf("%d\n", M);
  for (i = 0; i < n; printf("%d ", R[i++]))
    ;
}
