#include using namespace std; #ifdef LOCAL_DEBUG #include "LOCAL_DEBUG.hpp" #endif #define int long long signed main(){ int n; cin >> n; int ans = 1, cnt = 0;; while(n > 0){ if(n % 10 == 6 || n % 10 == 9 || n % 10 == 0 || n % 10 == 4) ans++; if(n % 10 == 8) ans += 2; n /= 10; cnt++; } cout << ans + cnt * 2 << endl; return 0; }