#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int n = s.size(), ans = 0;
  bool f = true;
  for (int k = 0; k < n; k++) {
    f = true;
    while (f) {
      f = false;
      if (k == 0) {
        if ((s[k] == '0' && s[k + 1] == '1') ||
            (s[k] == '1' && s[k + 1] == '0') && n > 1) {
          f = true;
          n -= 2;
          ans += 2;
          for (int i = k; i < n; i++) s[i] = s[i + 2];
        }
        continue;
      }
      if ((s[k] == '0' && s[k + 1] == '1') ||
          (s[k] == '1' && s[k + 1] == '0') && n > 1) {
        f = true;
        n -= 2;
        ans += 2;
        for (int i = k; i < n; i++) s[i] = s[i + 2];
        continue;
      }
      if ((s[k] == '0' && s[k - 1] == '1') ||
          (s[k] == '1' && s[k - 1] == '0') && n > 1) {
        f = true;
        n -= 2;
        ans += 2;
        for (int i = k - 1; i < n; i++) s[i] = s[i + 2];
        continue;
      }
    }
  }
  cout << ans;
  return 0;
}
