#include <bits/stdc++.h>
const double PI = acos(-1.0);
using namespace std;
const int MAXN = 500117;
int n, a[MAXN], ans;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; scanf("%d", &a[i++]))
    ;
  int j = 0, cur = 0;
  for (int i = 1; i < n - 1; i++) {
    if (a[i] != a[i - 1] && a[i] != a[i + 1]) {
      if (cur == 0) j = i;
      cur++;
    } else if (cur > 0) {
      ans = max(ans, (cur + 1) / 2);
      for (int k = j, t = i - 1; k <= t;
           a[k] = a[k - 1], a[t] = a[t + 1], k++, t--)
        ;
      cur = 0;
    }
  }
  if (cur > 0) {
    ans = max(ans, (cur + 1) / 2);
    for (int k = j, t = n - 2; k <= t;
         a[k] = a[k - 1], a[t] = a[t + 1], k++, t--)
      ;
  }
  printf("%d\n", ans);
  for (int i = 0; i < n; printf("%d ", a[i++]))
    ;
  putchar('\n');
  return 0;
}
