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