#include <string>
#include <vector>
#include <iostream>
#include <cmath>
#include <map>
#include <algorithm>
#include <sstream>
using namespace std;
int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
  
    string str;
    int i=1,cnt_zero=0,cnt_one=0,prev;
    cin >> str;
    prev = str[0] -'0';
    if(prev == 0) cnt_zero++;
    else cnt_one++;
    while(i != str.length())
    {
        string c = str.substr(i,1);
        i++;
        if(c == "1" && prev == 0)
            cnt_one++;
        else if(c == "0" && prev == 1)
            cnt_zero++;
        prev = stoi(c);
    }
    cout << ((cnt_one < cnt_zero)? cnt_one : cnt_zero);
    return 0;
}
- 최초 시도
1) 1과 0의 개수를 모두 구하면서, 연속된 1과 0의 카운트를 센다
2) 더 적은 개수의 연속된 카운트를 반환
--> 생각해보니 어차피 연속된 것은 하나로 칠 수 있으므로 1과 0의 개수를 세는것은 의미가 없다! 
- 정답 로직
: 1과 0의 연속된 개수를 구한 뒤 더 적은 개수를 반환!