#include using namespace std; #define ll long long #define endl "\n" #define rep(i, a, n) for (int i = a; i < n; ++i) int main() { string n; cin >> n; int cnt = 0; rep(i, 0, n.length()) { if (n[i] == '0') cnt++; } cout << abs(8 - cnt) << endl; return 0; }