#include <bits/stdc++.h>
using namespace std;
int main() {
  int l = 0, r = 1, len, sum = 0, bl[100050];
  string s;
  cin >> s;
  len = s.size();
  for (int i = 0; i <= len; i++) bl[i] = 0;
  while (r < len) {
    cout << l << " " << r << endl;
    if (s[l] + s[r] - '0' - '0' == 1) {
      bl[l] = 1;
      bl[r] = 1;
      sum += 2;
      r++;
      while (l >= 0) {
        if (bl[l] == 1)
          l--;
        else
          break;
      }
      if (l < 0) {
        r++;
        l = r - 1;
      }
    } else {
      r++;
      l = r - 1;
    }
  }
  cout << sum;
  return 0;
}
