#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
int main() {
  string s;
  cin >> s;
  int n = s.size();
  int zer, one;
  zer = one = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '0') zer++;
    if (s[i] == '1' and one < zer) one++;
  }
  if (zer != 0 and one != 0)
    cout << max(one * 2, zer * 2) << endl;
  else
    cout << 0 << endl;
}
