#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
ll x[] = {0, 1, 1, 2, 2, 1, 2, 2, 3, 3};

int main ()
{
    ios_base::sync_with_stdio(false);
    ll c=0, a; cin >> a;
    while(a) c+=x[a%10], a/=10;
    cout << c << endl;
    return 0;
}