#include <iostream>

using namespace std;

int cif(long long x)
{
	int s = 0;
	while (x)
	{
		x /= 10;
		s++;
	}
	return s;
}

int main()
{
	int k, c, S=0;
	long long n;
	cin >> n;
	c = cif(n);
	k = c - 1;
	while (k != -1)
	{
		int p = n / pow(10, k);
		switch (p)
		{
		case 0: break;
		case 1: S += 1; break;
		case 2: S += 1; break;
		case 3: S += 2; break;
		case 4: S += 2; break;
		case 5: S += 1; break;
		case 6: S += 2; break;
		case 7: S += 2; break;
		case 8: S += 3; break;
		case 9: S += 3; break;
		}
		n %= long long(pow(10, k));
		k--;
	}
	cout << S;
}