#include <bits/stdc++.h>
using namespace std;
ifstream f("input.in");
ofstream g("output.out");
int main(int argc, char **argv) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int a, b, c;
  string str;
  stack<char> s;
  getline(cin, str);
  int mov = 0;
  char t;
  s.push(str[0]);
  t = s.top();
  for (int i = 1; i < str.size(); ++i) {
    if (t == '0' && str[i] == '1' || t == '1' && str[i] == '0')
      ++mov;
    else {
      s.push(str[i]);
      t = s.top();
    }
  }
  cout << 2 * mov;
  return 0;
}
