#include <bits/stdc++.h>
using namespace std;
int br;
string v;
int main(){
cin>>v;
for(int i=0;i<=v.size()-1;i++){
if (v[i]=='0') br=0;
else if(v[i]=='1' or v[i]=='2' or v[i]=='5') br++;
else if(v[i]=='3' or v[i]=='4' or v[i]=='6' or v[i]=='7')br+=2;
else if(v[i]=='8' or v[i]=='9')br+=3;
else br=0;
}
cout<<br<<endl;
return 0;
}