#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pi = pair<int, int>;
using vi = vector<int>;
using vll = vector<ll>;
const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, 1, 0, -1};
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
void yes() {
  cout << "Yes" << endl;
  return;
}
void no() {
  cout << "No" << endl;
  return;
}
int main() {
  string s;
  cin >> s;
  int ans = 0;
  while (!s.empty()) {
    int pos0 = s.find("10");
    if (pos0 >= 0) {
      s.erase(s.begin() + pos0, s.begin() + pos0 + 2);
      ans += 2;
    }
    int pos1 = s.find("01");
    if (pos1 >= 0) {
      s.erase(s.begin() + pos1, s.begin() + pos1 + 2);
      ans += 2;
    }
    if (pos0 == -1 & pos1 == -1) {
      break;
    }
  }
  cout << ans << endl;
  return 0;
}
