#include <bits/stdc++.h>
const int N = 2e5 + 11;
int a[N], b[N], sz[N], fa[N];
int ans;
char s[N], c;
int st[N];
int cnt;
int main() {
  gets(s + 1);
  int n = strlen(s + 1);
  for (register int i = 1; i <= n; ++i) {
    if (s[i] == '1') {
      if (cnt) {
        if (c == '0')
          --cnt, ++ans;
        else
          ++cnt;
      } else
        ++cnt, c = s[i];
    } else {
      if (cnt) {
        if (c == '1')
          --cnt, ++ans;
        else
          ++cnt;
      } else
        ++cnt, c = s[i];
    }
  }
  printf("%d\n", ans + ans);
  return 0;
}
