#include <bits/stdc++.h>
using namespace std;
int main() {
  int cnt = 0;
  string s;
  getline(cin, s);
  while (1) {
    auto it1 = s.find("10");
    if (it1 != string::npos) {
      cnt += 2;
      s.erase(it1, 2);
    }
    auto it2 = s.find("01");
    if (it2 != string::npos) {
      cnt += 2;
      s.erase(it2, 2);
    }
    if (it1 == string::npos && it2 == string::npos) break;
  }
  cout << cnt << endl;
  return 0;
}
