#include <iostream>
using namespace std;
int main()
{
    unsigned long long n;
    int z=0;
    cin>>n;
    int a[]={0, 1, 1, 2, 2, 1, 2, 2, 3, 3};
    while(n>0){
        z+=a[n%10];
        n/=10;
    }
    cout<<z<<"\n";
    return 0;
}