#include <bits/stdc++.h>

using namespace std;

int brojac;
int v,i;
string s;
int main()
{
getline(cin, s);



brojac=0;

for(s[i];s[i]<=s[s.size()];i++)
{
    if (s[i]=='0')
        brojac=brojac;

   else if (s[i]=='1')
        brojac=brojac+1;

 else   if (s[i]=='2')
        brojac=brojac+1;


else    if (s[i]=='3')
        brojac=brojac+2;


else    if (s[i]=='4')
        brojac=brojac+2;


    else if (s[i]=='5')
        brojac=brojac+1;


    else if (s[i]=='6')
        brojac=brojac+2;

    else if (s[i]=='7')
        brojac=brojac+2;

   else if (s[i]=='8')
        brojac=brojac+3;

   else if (s[i]=='9')
        brojac=brojac+3;
        else
            brojac=brojac;
}


cout<<brojac;


return 0;






}