#include <bits/stdc++.h>
using namespace std;
int main() {
  string str;
  cin >> str;
  int i = 0;
  while ((i < str.size()) && (str[i] == '?')) {
    i++;
  }
  if (i >= str.size()) {
    cout << 1 << endl;
    return 0;
  }
  int idx = i;
  while (i < str.size()) {
    if (str[i] == '?') {
      if (str[i - 1] == '1') {
        str[i] = '0';
      } else {
        str[i] = '1';
      }
    }
    i++;
  }
  cout << str << endl;
  i = idx;
  int maximum = 0;
  while (i < str.size()) {
    char ch = str[i];
    int maxi = 0;
    while (str[i] == ch) {
      maxi++;
      i++;
    }
    if (maxi > maximum) {
      maximum = maxi;
    }
  }
  cout << maximum << endl;
}
