#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  string redblue = "01";
  string bluered = "10";
  cin >> s;
  vector<int> ans;
  int check, total = 0;
  size_t pos = std::string::npos;
  while (check != 1) {
    while ((pos = s.find(redblue)) != std::string::npos) {
      s.erase(pos, redblue.length());
      total = total + 2;
    }
    int temp = total;
    while ((pos = s.find(bluered)) != std::string::npos) {
      s.erase(pos, bluered.length());
      total = total + 2;
    }
    if (temp == total) {
      check = 1;
    }
  }
  cout << total;
}
