#include <bits/stdc++.h>
using namespace std;
string V,p; int br,x;
int main()
{
    br=0;
    cin>>V;
    for (int i=0; i<=V.size()-1; i++){
    if(V[i]=='1' or V[i]=='2' or V[i]=='5') br+=1;
    if(V[i]=='3' or V[i]=='4' or V[i]=='6' or V[i]=='7') br+=2;
    if(V[i]=='8' or V[i]=='9') br+=3;
    }
    cout<<br<<endl;
    return 0;
}