#include using namespace std; #define REP(i,n) for(int i=0; i<(int)(n); i++) int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n; cin >> n; int ds[10] = {4, 3, 3, 3, 4, 3, 4, 3, 5, 4}; int ret = 0; int c = 0; while (n) { ++c; ret += ds[n % 10]; n /= 10; } ret -= c-1; cout << ret << endl; return 0; }