#include <bits/stdc++.h>
using namespace std;
int main() {
  string s_input;
  cin >> s_input;
  int n = s_input.length();
  int s[n];
  for (int i = 0; i < n; i++) {
    s[i] = s_input[i] - '0';
  }
  int cnt = 0, first = 0, end = 1;
  while (true) {
    if (n == first) break;
    if (n == end) break;
    if (s[first] + s[end] == 1) {
      s[first] = 2;
      s[end] = 2;
      cnt += 2;
      for (int i = 0; i < n; i++) {
        if (s[i] == 2) continue;
        first = i;
        break;
      }
      for (int i = first + 1; i < n; i++) {
        if (s[i] == 2) continue;
        end = i;
        break;
      }
      continue;
    }
    if (end == n) first++;
    end++;
  }
  cout << cnt << endl;
  return 0;
}
