#include<iostream>
using namespace std;
int main()
{
	int x,br=0;
	long long a;
	cin>>a;
	while(a>0)
	{
		x=a%10;
		if(x==1 || x==2 || x==5)
			br++;
		else if(x==3 || x==4 || x==6 || x==7)
			br=br+2;
		else if(x==8 || x==9)
			br=br+3;
		a=a/10;
	}
	cout<<br;
}