#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define FOR(i,k,n) for (int (i)=(k); (i)<(n); ++(i)) #define rep(i,n) FOR(i,0,n) #define all(v) begin(v), end(v) #define debug(x) cerr<< #x <<": "< pii; typedef vector vi; typedef vector > vvi; typedef vector vll; typedef vector > vvll; typedef deque db; template using vv=vector >; int main() { string s; cin >> s; vi inc = {1, 0, 0, 0, 1, 0, 1, 0, 2, 1}; int len = s.length(); int ans = 2 * len + 1; rep (i, len) { ans += inc[s[i] - '0']; } printf("%d\n", ans); return 0; }