#include <bits/stdc++.h>
using namespace std;
const int inf = (int)1e6 + 5;
const int nax = (int)3e5 + 5;
void compute() {
  string s;
  cin >> s;
  int n = s.length();
  long long res = 0;
  int flag = 1;
  while (flag) {
    flag = 0;
    string t;
    n = s.length();
    for (int i = 0; i < (int)n - 1; ++i) {
      if ((s[i] == '0' && s[i + 1] == '1') ||
          (s[i] == '1' && s[i + 1] == '0')) {
        s[i] = '.', s[i + 1] = '.';
        res += 2;
        flag = 1;
      }
    }
    if (!flag) break;
    t = "";
    for (int i = 0; i < (int)n; ++i) {
      if (s[i] == '.') continue;
      t += s[i];
    }
    s = t;
  }
  cout << res << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  compute();
  return 0;
}
