#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int n = s.size();
  int zero, one;
  int loop_count = 1;
  int answer = 0;
  int memo;
  while (loop_count != 0) {
    loop_count = 0;
    zero = 0;
    one = 0;
    for (int i = 0; i < n; i++) {
      if (s[i] == '0') {
        zero++;
        one = 0;
      }
      if (s[i] == '1') {
        one++;
        zero = 0;
      }
      if (zero == 1 || one == 1) {
        memo = i;
      }
      if (zero == 2 || one == 2) {
        s[i] = '2';
        s[memo] = '2';
        loop_count++;
        one = 0;
        zero = 0;
        answer += 2;
      }
    }
  }
  cout << answer << endl;
}
