#include #include using namespace std; int main() { string s; cin >> s; int ans = s.size() * 2 + 1; for (auto c : s) { switch (c - '0') { case 8: ans += 2; break; case 0: case 4: case 6: case 9: ans += 1; break; default: break; } } cout << ans << endl; return 0; }