#include<iostream>
#include<string>

using namespace std;

int main() {

	string num;
	cin >> num;
	int br=0;


	for (int i = 0; i < num.size(); i++) {

		
		if (num[i] != '0') {

		if ((num[i] == '1') || (num[i] == '2') || (num[i] == '5')) br++;

		else if ((num[i] == '8') || (num[i] == '9')) br += 3;

		else br += 2; 
		}
	}

	cout << br;
	return 0;
}