0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-09 02:18:51 +00:00
OI-codes/Luogu/P2708/P2708.cpp

20 lines
321 B
C++
Raw Normal View History

2020-11-18 10:08:10 +00:00
#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;
}