#include <bits/stdc++.h>
using namespace std;
void func(int index1, int index2, vector<int>& arr, vector<int>& vect) {
  if (index1 - index2 <= 1) return;
  if ((index1 - index2) & 1) {
    for (int h = index2 + 1; h <= (index1 + index2) / 2; h++)
      vect[h] = arr[h - 1];
    for (int h = index1 - 1; h > (index1 + index2) / 2; h--)
      vect[h] = arr[h + 1];
  } else {
    for (int h = index2 + 1; h < index1; h++) vect[h] = arr[h - 1];
  }
}
int main() {
  {
    int n;
    cin >> n;
    vector<int> arr(n);
    vector<int> vect(n);
    for (int i = 0; i < n; i++) scanf("%d", &arr[i]);
    int ans = 0, index1 = 0, index2 = 0;
    vect[0] = arr[0];
    vect[n - 1] = arr[n - 1];
    for (int i = 1; i < n - 1; i++) {
      if (arr[i] == arr[i - 1] || arr[i] == arr[i + 1]) {
        index2 = index1;
        index1 = i;
        int temp = ceil((index1 - index2 - 1) / 2.0);
        ans = max(ans, temp);
        func(index1, index2, arr, arr);
      }
    }
    ans = max(ans, (int)ceil((n - index1 - 2) / 2.0));
    func(n - 1, index1, arr, arr);
    cout << ans << endl;
    for (int i = 0; i < n; i++) cout << arr[i] << " ";
    cout << endl;
  }
}
