#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int main()
{
    unsigned long long int ossz;
    unsigned long long int n;
    int count = 0;
    scanf("%llu",&ossz);
    int hatvany;

    n=ossz;
    while(n != 0)
    {
        n /= 10;
        ++count;
    }

    unsigned long long int a[count];
    int k=0;
    a[0]=ossz/pow(10,(count));
    for(int i=count-1;i>=0;i--)
    {
        k++;
        hatvany=pow(10,i);
        a[k]=(ossz/hatvany)%10;
    }

    int fin=0;

    for(int i=0;i<=count;i++)
    {
        if(a[i]==1 || a[i]==2 || a[i]== 5)
            fin++;

        else if(a[i]==3 || a[i]==4 || a[i]== 6 || a[i]==7)
            fin+=2;

        else if(a[i]==8 || a[i]==9)

            fin+=3;
    }

    printf("%d",fin);




    return 0;
}