#include using namespace std; typedef long long int ll; #define rep(i, n) for (int i = 0; i < (n); i++) int main() { cin.tie(0); ios::sync_with_stdio(false); string s, t = "1000000007"; //100000000007 int ans = 0; cin >> s; if (s.size() == t.size()) for (int i = 0; i < t.size(); i++) { if (s[i] != t[i] && t[i] == '0') ans++; } if (s.size() > t.size()) for (int i = 0; i < s.size(); i++) { if (s[i] != t[i] && s[i] == '0') ans++; } if (s.size() < t.size()) for (int i = 0; i < s.size(); i++) { if (s[i] != t[i] && t[i] == '0') ans++; } cout << ans << endl; return 0; }