#include <bits/stdc++.h>
using namespace std;
long long v,a,brn=0;
int main (){
	cin>>v;
	while (v>0){
		a=v%10;
		if(a==0){}
		if((a==1)or(a==2)or(a==5) ){brn++;}
		if((a==3)or(a==4)or(a==6)or(a==7)){brn=brn+2;}
		if((a==8)or(a==9)){brn=brn+3;}
		v=v/10;
	}
	cout<<brn<<endl;
	return 0;
}