#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
long long n, ans = 0, m, q;
string second;
int32_t main() {
  cin >> second;
  n = second.size();
  for (long long i = 1; i < n; i++) {
    m = 2;
    if (second[i] == '0' && second[i - 1] == '1') {
      ans = ans + 2;
      second[i] = '2';
      second.erase(i, i + 1);
      second[i - 1] = '2';
      second.erase(i - 2, i);
      while ((second[i] == '1' && second[i - 1] == '0') ||
             (second[i] == '0' && second[i - 1] == '1')) {
        ans = ans + 2;
        second[i] = '2';
        second[i - 1] = '2';
        second.erase(i, i + 1);
        second.erase(i - 2, i);
        m++;
      }
    } else if (second[i] == '1' && second[i - 1] == '0') {
      ans = ans + 2;
      second[i] = '2';
      second.erase(i, i + 1);
      second[i - 1] = '2';
      second.erase(i - 2, i);
      while ((second[i] == '1' && second[i - 1] == '0') ||
             (second[i] == '0' && second[i - 1] == '1')) {
        ans = ans + 2;
        second[i] = '2';
        second[i - 1] = '2';
        second.erase(i, i + 1);
        second.erase(i - 2, i);
        m++;
      }
    }
  }
  cout << ans * 2;
  return 0;
}
