#include <bits/stdc++.h>

using namespace std;

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

i=0;

brojac=0;

for(s[i];i<s.size() ;i++)

 {

if (s[i]=='1' or s[i]=='2' or s[i]=='5')
{
    brojac++
;}




   else  if (s[i]=='7' or s[i]=='6' or s[i]=='4' or s[i]=='3')
     {
         brojac=brojac+2;
     }

  else if(s[i]=='8' or s[i]=='9')

         brojac=brojac+3;
else brojac=brojac;



}



cout<<brojac<<endl;


return 0;
}