#include #define REP(i, a, n) for(int i = (a); i < (n); i++) using namespace std; long table[10] = { 4, 3, 3, 3, 4, 3, 4, 3, 5, 4 }; int main(void) { string s; cin >> s; long ans = 0; REP(i, 0, s.length()) { ans += table[s[i] - '0']; } if(s.length() > 1) { ans -= s.length() - 1; } cout << ans << endl; return 0; }