#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  long int soma = 0;
  int i = 0;
  while (i + 2 <= s.size() - 1) {
    if (s[i] != s[i + 2]) {
      soma += 2;
    }
    i++;
  }
  cout << soma << endl;
  return 0;
}
