0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-30 20:16:27 +00:00
OI-codes/Luogu/P2708/P2708.cpp

20 lines
321 B
C++

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