#include <bits/stdc++.h>
using namespace std;
bool check(int a, int b) { return a > b; }
int main() {
  char s[100010];
  cin >> s;
  int n = strlen(s);
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    a[i] = s[i] - '0';
  }
  int l, r;
  int ans = 0;
  for (int i = 0; i < n - 1; i++) {
    if (a[i] == -1) {
      continue;
    }
    r = i + 1;
    l = i;
    if (a[l] + a[r] == 1) {
      while (0 <= l && r < n) {
        ans += 2;
        a[l] = -1;
        a[r] = -1;
        if (l == 0) {
          break;
        }
        while (0 < l) {
          l--;
          if (a[l] != -1) {
            break;
          }
        }
        if (a[l] == -1) {
          break;
        }
        if (r == n - 1) {
          break;
        }
        while (r < n - 1) {
          r++;
          if (a[r] != -1) {
            break;
          }
        }
      }
    }
    i = r - 1;
  }
  cout << ans << endl;
  return 0;
}
