#include <bits/stdc++.h>
using namespace std;
template <typename T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
template <typename T>
T lcm(T a, T b) {
  return a * b / gcd(a, b);
}
int main() {
  vector<int> S(1000000);
  int ans = 0;
  int top = 0;
  char s[1];
  while (scanf("%c", &s[0]) != EOF) {
    S[top] = s[0] - '0';
    if (top > 0) {
      if (S[top] != S[top - 1]) {
        ans++;
        top--;
      }
    }
    top++;
  }
  cout << ans * 2 << endl;
}
