#include <iostream>
using namespace std;

int main() {
	string s;
	int ans = 0;
	cin >> s;
	for (int i = 0; i < s.size(); ++i)
	{
		if (s[i] == '1' || s[i] == '2' || s[i] == '5') ans += 1;
		else if (s[i] == '3' || s[i] == '4' || s[i] == '6' || s[i] == '7') ans += 2;
		else if (s[i] != '0') ans += 3;
	}
	cout << ans;
	return 0;
}