#include <bits/stdc++.h>
using namespace std;
using namespace std;
long long maxAns(string s, int count) {
  int max = count;
  int tmp = 0;
  std::string::size_type pos;
  if (s.size() < 2) return count;
  string find_word = "01";
  pos = s.find(find_word);
  while (pos != std::string::npos) {
    string reps = s;
    reps.replace(pos, find_word.length(), "");
    tmp = maxAns(reps, count + 2);
    if (tmp > max) max = tmp;
    pos = s.find(find_word, pos + find_word.length());
  }
  find_word = "10";
  pos = s.find(find_word);
  while (pos != std::string::npos) {
    string reps = s;
    reps.replace(pos, find_word.length(), "");
    tmp = maxAns(reps, count + 2);
    if (tmp > max) max = tmp;
    pos = s.find(find_word, pos + find_word.length());
  }
  return max;
}
void solve() {
  string s;
  cin >> s;
  long long count = 0;
  long long ret = maxAns(s, 0);
  std::cout << ret << std::endl;
}
int main(int argc, char *argv[]) {
  solve();
  return 0;
}
