#include <bits/stdc++.h>
using namespace std;
const int INF = INT_MAX;
const long long INFL = 1LL << 40;
const double PI = atan(1) * 4;
int dy[] = {0, 0, 1, -1, 0};
int dx[] = {1, -1, 0, 0, 0};
template <typename T>
istream& operator>>(istream& is, vector<T>& vec) {
  for (T& x : vec) is >> x;
  return is;
}
template <typename T>
ostream& operator<<(ostream& os, vector<T>& vec) {
  for (int i = 0; i < vec.size(); i++) {
    os << vec[i] << (i + 1 == vec.size() ? "" : " ");
  }
  return os;
}
int main() {
  string s;
  cin >> s;
  int cnt = 0;
  while (s.size() > 0) {
    string t;
    int sizepre = (int)s.size();
    for (auto i = 0; i < sizepre; i++) {
      if (s[i] == '0' && i + 1 < sizepre && s[i + 1] == '1') {
        i++;
        cnt++;
      } else if (s[i] == '1' && i + 1 < sizepre && s[i + 1] == '0') {
        i++;
        cnt++;
      } else {
        t += s[i];
      }
    }
    s = t;
    if (sizepre == s.size()) {
      break;
    }
  }
  cout << cnt * 2 << endl;
  return 0;
}
