#include <iostream>
#include <sstream>
#include <algorithm>
#include <iomanip>




using namespace std;

int main()
{
	int n;
	int g, k, p, z;
	std::string s;
	z = 0;
	k = 0;


	cin >> s;


	for (n = 0; n < s.length(); n++)
	{


		if (s[n] == '3') k = 2; else
			if (s[n] == '4') k = 2; else
				if (s[n] == '6') k = 2; else
					if (s[n] == '7') k = 2; else
						if (s[n] == '8') k = 3; else
							if (s[n] == '0') k = 0; else
								if (s[n] == '9') k = 3; else
									
									k = 1;
		z = z + k;


	}
	cout << z;

}