#include <cstdio>

int digit(const int d)
{
	if (d == 1 || d == 2 || d == 5)
		return 1;
	if (d == 3 || d == 4 || d == 6
		|| d == 7)
		return 2;
	if (d == 8 || d == 9)
		return 3;
}

int main()
{
	using u64 = unsigned long long;

	u64 v;

	std::scanf("%llu", &v);
	
	unsigned int count = 0;
	while (v > 0)
	{
		int d = v % 10;
		count += digit(d);
		v /= 10;
	}

	std::printf("%u\n", count);

}