#include <bits/stdc++.h>
using namespace std;
constexpr auto INF = 1000000000;
constexpr auto mod = 1000000007;
int gcd(int a, int b) {
  if (b > a) swap(a, b);
  if (a % b == 0) return b;
  return gcd(b, a % b);
}
int ans = 0;
int s[10][10];
int k[10];
int p[10];
void bit(int m, int n, int d) {
  stack<string> st;
  st.push("");
  while (!st.empty()) {
    string now = st.top();
    st.pop();
    if (now.size() == n) {
      bool w = true;
      for (int i = (0); i < (d); i++) {
        int x = 0;
        for (int j = (0); j < (k[i]); j++)
          if (now[s[i][j] - 1] == '1') x++;
        if (x % 2 != p[i]) w = false;
      }
      if (w) ans += 1;
    } else {
      for (int i = m - 1; i >= 0; i--) {
        string next = now + to_string(i);
        st.push(next);
      }
    }
  }
};
int main() {
  string s;
  cin >> s;
  int n = s.size();
  int ans = 0;
  if (n != 1) {
    for (int i = (0); i < (s.size() - 1); i++) {
      if ((s[i] == '0' && s[i + 1] == '1') ||
          (s[i] == '1' && s[i + 1] == '0')) {
        ans += 2;
        s.erase(i, 2);
        i = 0;
        cout << s << endl;
      }
    }
  }
  cout << ans << endl;
  return 0;
}
