#include <iostream>
#include <math.h>


int vrd (int a){
	
int ub=0;	

if (a==1||a==2||a==5){ub=1;}
if (a==3||a==4||a==6||a==7){ub=2;}
if (a==8||a==9){ub=3;}


return ub;
}

int main(){
	
	int V;
	
	std::cin>>V;
	int priv=V;
	int UN = 0;
	int duzina = 0;
	
	while (priv>=10 ){
		priv=priv/10;
		duzina=duzina+1;
	}
	duzina=duzina+1;
	
	int k=1;
	while (k<pow(10, duzina)){
		UN=UN+vrd(V/k%10);
		k=k*10;
	}
	
	
	
	std::cout<<UN;
	return 0;
}