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