#include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); string S; cin >> S; int res = 0; for (auto s : S) { if (s != '0') res++; } cout << res - 1 << '\n'; return 0; }