#include <bits/stdc++.h>
using namespace std;
void append(string& s) {
  int i = 0;
  while (s[i] != '\0') {
    if (s[i] == '2') {
      s.erase(s.begin() + i);
      i--;
    }
    i++;
  }
}
int search(string& s) {
  int res = 0;
  int i = 0;
  while (s[i] != '\0') {
    if ((s[i] == '0' && s[i + 1] == '1') || (s[i] == '1' && s[i + 1] == '0')) {
      res += 2;
      s[i] = '2';
      s[i + 1] = '2';
      i++;
    }
    i++;
  }
  append(s);
  return res;
}
int main() {
  string s;
  cin >> s;
  int cnt = 0;
  bool flag = true;
  while (true) {
    if (flag == false) {
      break;
    }
    int tmp = search(s);
    if (tmp > 0) {
      cnt += tmp;
    } else {
      flag = false;
    }
  }
  cout << cnt << endl;
  return 0;
}
