#include <bits/stdc++.h>
using namespace std;
vector<vector<string>> getinputdata();
vector<vector<int>> getinputdata2();
vector<vector<double>> getinputdata3();
void abc120_c(vector<vector<string>> v) {
  string s = v[0][0];
  bool chkflg = true;
  int sposi = 0;
  int num = 0;
  while (chkflg) {
    if (s.find("01", sposi) != string::npos ||
        s.find("10", sposi) != string::npos) {
      num += 1;
      int cnt1 = s.find("01", sposi);
      int cnt2 = s.find("10", sposi);
      if (cnt1 > cnt2) {
        s.replace(cnt1, 2, "");
      } else {
        s.replace(cnt2, 2, "");
      }
    } else {
      chkflg = false;
    }
  }
  cout << num * 2 << endl;
}
int main() {
  vector<vector<string>> vec_arr_result;
  vec_arr_result = getinputdata();
  abc120_c(vec_arr_result);
  return 0;
}
vector<vector<double>> getinputdata3() {
  string str;
  string ret;
  stringstream ss;
  vector<string> v1;
  vector<vector<double>> vec_arr;
  while (getline(cin, str)) {
    v1.push_back(str);
  }
  for (string s : v1) {
    vector<double> array_data;
    ss << s;
    while (!ss.eof()) {
      ss >> ret;
      array_data.push_back(atof(ret.c_str()));
    }
    vec_arr.push_back(array_data);
    ss.str("");
    ss.clear(stringstream::goodbit);
  }
  return vec_arr;
}
vector<vector<int>> getinputdata2() {
  string str;
  string ret;
  stringstream ss;
  vector<string> v1;
  vector<vector<int>> vec_arr;
  while (getline(cin, str)) {
    v1.push_back(str);
  }
  for (string s : v1) {
    vector<int> array_data;
    ss << s;
    while (!ss.eof()) {
      ss >> ret;
      array_data.push_back(atoi(ret.c_str()));
    }
    vec_arr.push_back(array_data);
    ss.str("");
    ss.clear(stringstream::goodbit);
  }
  return vec_arr;
}
vector<vector<string>> getinputdata() {
  string str;
  string ret;
  stringstream ss;
  vector<string> v1;
  vector<vector<string>> vec_arr;
  while (getline(cin, str)) {
    v1.push_back(str);
  }
  for (string s : v1) {
    vector<string> array_data;
    ss << s;
    while (!ss.eof()) {
      ss >> ret;
      array_data.push_back(ret);
    }
    vec_arr.push_back(array_data);
    ss.str("");
    ss.clear(stringstream::goodbit);
  }
  return vec_arr;
}
