#include <bits/stdc++.h>
using namespace std;
ifstream f("input.in");
ofstream g("output.out");
int findcube(string str, int mov) {
  if (str.size() < 2 || str == "00" || str == "11") return mov;
  int max_mov = mov;
  for (int i = 0; i < str.size() - 1; ++i) {
    if (str[i] == '0' && str[i + 1] == '1' ||
        str[i] == '1' && str[i + 1] == '0') {
      string cp = str;
      cp.erase(i, 2);
      max_mov = max(max_mov, findcube(cp, mov + 1));
    }
  }
  return max_mov;
}
int main(int argc, char **argv) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int a, b, c;
  string str;
  getline(cin, str);
  cout << 2 * findcube(str, 0);
  return 0;
}
