#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] == '1') || (num[i] == '2') || (num[i] == '5')) br++;

		else if ((num[i] == '3') || (num[i] == '4') || (num[i] == '6') || (num[i] == '7')) br += 2;

		else br += 3; 
	}

	cout << br;

	return 0;
}