#include <iostream>
#include <stdio.h>
using namespace std;

int main()
{
    char a;
    int b;
    int cif=0;
    while((a=getchar())!=EOF)
    {
        b=a-48;
        //cout<<b<<endl;
        if(b==1||b==2||b==5)    cif++;
        if(b==3||b==4||b==6||b==7)      cif+=2;
        if(b==8||b==9)      cif+=3;

    }
    cout<<cif;
}