#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  int idx;
  int counter = 0;
  while (1) {
    int flag0 = 0;
    int flag1 = 0;
    idx = (int)S.find("01");
    if (idx >= 0) {
      S.erase(S.begin() + idx, S.begin() + idx + 2);
      counter += 2;
    } else {
      flag0 = 1;
    }
    idx = (int)S.find("10");
    if (idx >= 0) {
      S.erase(S.begin() + idx, S.begin() + idx + 2);
      counter += 2;
    } else {
      flag1 = 1;
    }
    if (flag0 && flag1) break;
  }
  cout << counter << endl;
  return 0;
}
