#include <bits/stdc++.h>
using namespace std;
string S;
int rec(string s, int a) {
  if (s.size() < 2) return a;
  int ans = a;
  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 =
          max(ans, rec(s.substr(0, i) + s.substr(i + 2, s.size() - 2), a + 2));
    }
  }
  return ans;
}
int main() {
  cin >> S;
  cout << rec(S, 0) << endl;
}
