#include <stdio.h>
#include <string.h>

int main()
{
    char v[20];
    int br=0;
    scanf("%s",v);
    for (int i=0;i<strlen(v);i++)
    {
        if (v[i]=='1') br++;
        else if (v[i]=='2') br++;
        else if (v[i]=='3') br+=2;
        else if (v[i]=='4') br+=2;
        else if (v[i]=='5') br++;
        else if (v[i]=='6') br+=2;
        else if (v[i]=='7') br+=2;
        else if (v[i]=='8') br+=3;
        else if (v[i]=='9') br+=3;
    }
    printf("%d",br);
    return 0;
}