#include <bits/stdc++.h>
int main(void) {
  std::string inputStr;
  std::cin >> inputStr;
  int strSize = inputStr.size();
  int deleteStrNum = 0;
  for (int ii = 1; ii < strSize; ii++) {
    if (strSize < 2) {
      break;
    }
    if (inputStr.compare((ii - 1), 1, "0") == 0) {
      if (inputStr.compare(ii, 1, "1") == 0) {
        for (int jj = (ii - 1); jj < (strSize - 2); jj++) {
          inputStr[jj] = inputStr[jj + 2];
        }
        deleteStrNum = deleteStrNum + 2;
        strSize = strSize - 2;
        if (ii == 1) {
          ii = ii - 1;
        } else {
          ii = ii - 2;
        }
      }
    } else {
      if (inputStr.compare(ii, 1, "0") == 0) {
        for (int jj = (ii - 1); jj < (strSize - 2); jj++) {
          inputStr[jj] = inputStr[jj + 2];
        }
        deleteStrNum = deleteStrNum + 2;
        strSize = strSize - 2;
        if (ii == 1) {
          ii = ii - 1;
        } else {
          ii = ii - 2;
        }
      }
    }
  }
  std::cout << deleteStrNum;
  return 0;
}
