#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using Graph = vector<vi>;
using vb = vector<bool>;
using boolGraph = vector<vb>;
using P = pair<int, int>;
const int MOD = 1e9 + 7;
const int MOD2 = 998244353;
const double EPS = 1e-9;
template <typename T>
struct is_vector : false_type {};
template <typename T>
struct is_vector<vector<T>> : true_type {};
template <typename T>
ostream &operator<<(ostream &ostr, const vector<T> &vec) {
  if (vec.empty()) {
    return ostr;
  }
  ostr << vec.front();
  for (auto itr = ++vec.begin(); itr != vec.end(); ++itr) {
    if (is_vector<T>())
      ostr << "\n" << *itr;
    else
      ostr << ' ' << *itr;
  }
  return ostr;
}
void solve() {
  string s;
  cin >> s;
  vi cnt(2, 0);
  for (int i = 0; i < (int)(s.size()); ++i) ++cnt[s[i]];
  cout << 2 * min(cnt[0], cnt[1]) << endl;
}
int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(12);
  solve();
  return 0;
}
