#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  int N = S.size();
  int ans = 0;
  while (1) {
    string New = "";
    int sum = 0;
    for (int i = 0; i < N; i++) {
      if (i == N - 1) {
        New += S.at(i);
        sum += (S.at(i) - '0');
        break;
      }
      if (S.at(i) == '1' && S.at(i + 1) == '0') {
        ans += 2;
        i++;
        continue;
      }
      if (S.at(i) == '0' && S.at(i + 1) == '1') {
        ans += 2;
        i++;
        continue;
      }
      New += S.at(i);
      sum += (S.at(i) - '0');
    }
    N = New.size();
    if (sum == N || sum == 0) break;
    S = New;
  }
  cout << ans << endl;
  return 0;
}
