#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  getline(cin, s);
  int cnt = 0, i = 0, j = s.length();
  while (i <= j) {
    if ((s[i] == '0' && s[i + 1] == '1') || (s[i] == '1' && s[i + 1] == '0')) {
      cnt += 2;
      s.erase(i, 2);
      j -= 2;
    } else {
      i += 1;
    }
    if ((s[j] == '1' && s[j - 1] == '0') || (s[j] == '0' && s[j - 1] == '1')) {
      cnt += 2;
      s.erase(j - 1, 2);
      j -= 2;
    } else {
      j -= 1;
    }
  }
  cout << cnt << endl;
  return 0;
}
