#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  string str;
  stack<int> st;
  cin >> str;
  int len = str.size(), cnt1 = 0, cnt2 = 0;
  int ans = 0, res = 0;
  for (int i = 0; i < len; i++) {
    if (str[i] == '1')
      cnt1++;
    else if (str[i] == '0' && cnt1 > 0) {
      cnt1--;
      ans += 2;
    }
  }
  res = max(res, ans);
  ans = 0;
  for (int i = 0; i < len; i++) {
    if (str[i] == '0')
      cnt2++;
    else if (str[i] == '1' && cnt2 > 0) {
      cnt2--;
      ans += 2;
    }
  }
  res = max(res, ans);
  cout << res << endl;
  return 0;
}
