#include <bits/stdc++.h>
using namespace std;

int main() {
	
	string s;
	cin >> s;
			   // 0  1  2  3  4  5  6  7  8  9
	int c[10] = { 0, 1, 1, 2, 2, 1, 2, 2, 3, 3 };

	int v = 0;

	for (int i = 0; i < s.length(); i++) {
		v += c[s[i] - '0'];
	}

	cout << v << endl;
	
	return 0;
}