#include #include #define chmin(x,y) (x) = min((x),(y)) #define chmax(x,y) (x) = max((x),(y)) #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define vec vector #define all(a) a.begin(), a.end() #define rall(a) a.rbegin(), a.rend() #define pb push_back #define eb emplace_back using namespace std; using namespace atcoder; using ll = long long; using ld = long double; const ll mod = 998244353; using mint = modint998244353; const vector dx = {1,0,-1,0}, dy = {0,1,0,-1}; // using Graph = vector>>; using Graph = vector>; int main(){ // input string S; cin >> S; int N = S.size(); // solve int ans = 0; rep(i,N-2){ int judge = 0; if(S[i] == S[i+1]) judge++; if(S[i+2] == S[i+1]) judge++; if(judge == 1) ans++; } // output cout << ans << endl; }