#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
const ll MOD = 1000000007;
void replaceAll(string &s, string from, string to) {
  int pos;
  int len = from.size();
  while ((pos = s.find(from)) != string::npos) {
    s.replace(pos, len, to);
  }
}
void solve() {
  string s;
  cin >> s;
  int ans = 0;
  while (true) {
    int p0 = s.find("01");
    int p1 = s.find("10");
    if (p0 == string::npos) {
      if (p1 == string::npos) break;
      s.replace(p1, 2, "");
    } else if (p1 == string::npos) {
      s.replace(p0, 2, "");
    } else if (p0 < p1) {
      s.replace(p0, 2, "");
    } else {
      s.replace(p1, 2, "");
    }
    ans += 2;
  }
  std::cout << (ans) << "\n";
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  srand((unsigned)time(NULL));
  cout << fixed << setprecision(12);
  solve();
}
