#include <iostream>

using namespace std;

int main()
{
long long V;
cin>>V;
int s=0;
int c;
while (V>0)
{
    c=V%10;
    if (c==1 || c==2 || c==5)
        s=s+1;
    if (c==3 || c==4 || c==6 || c==7)
        s=s+2;
    if (c==8 || c==9)
        s=s+3;
    V=V/10;
}
cout<<s;
  return 0;
}