#include<iostream>
using namespace std;
long long V,br=0;
int main(){
	int c;
	cin>>V;
	while(V>0){
		c=V%10;
		switch(c){
			case 1: case 2:case 5: br++;break;
			case 3: case 4: case 6:case 7: br+=2;break;
			case 8:case 9:br+=3;break;
			default: continue;
		}
		V/=10;
	}
	cout<<br;
}