#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int N = s.size(), cnt = 0;
  for (int i = 0; i < N; i++) {
    char a, b;
    if (s[i] != 'a')
      a = s[i];
    else
      continue;
    for (int j = i + 1; j < N; j++) {
      if (s[j] != 'a') b = s[j];
      if ((s[i] == '0' && s[j] == '1') || (s[i] == '1' && s[j] == '0')) {
        cnt += 2;
        s[i] = a;
        s[j] = a;
        break;
      }
    }
  }
  cout << cnt << endl;
}
