#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define X first #define Y second #define pb push_back #define rep(X,Y) for (int (X) = 0;(X) < (Y);++(X)) #define reps(X,S,Y) for (int (X) = S;(X) < (Y);++(X)) #define rrep(X,Y) for (int (X) = (Y)-1;(X) >=0;--(X)) #define repe(X,Y) for ((X) = 0;(X) < (Y);++(X)) #define peat(X,Y) for (;(X) < (Y);++(X)) #define all(X) (X).begin(),(X).end() #define rall(X) (X).rbegin(),(X).rend() #define eb emplace_back #define UNIQUE(X) (X).erase(unique(all(X)),(X).end()) using namespace std; typedef long long ll; typedef pair pii; typedef pair pll; int main() { int n; cin >> n; int ans = 1, k, m; int add[10] = {3,2,2,2,3,2,3,2,4,3}; int add2[10] = {3,1,1,1,3,1,3,1,4,3}; m = n; do { k = m % 10; n = m / 10; ans += add[k]; } while (m != 0); m = n; int ans2 = 2; do { k = m % 10; n = m / 10; ans2 += add2[k]; } while (m != 0); cout << (ans