#include<iostream>
using namespace std;

char V[20];
short unsigned br;
int i ;
main(){
	ios::sync_with_stdio(false);
	cin >> V;
	while (V[i] != '\0'){
		switch (V[i]){
			case '1' : case '2' : case '5' : br++; break;
			case '3' : case '4' : case '6' : case '7': br+=2; break;
			case '0' : break;
			default : br+=3;
		}
		i++;
	}
	cout << br;
}