using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Isplata
{
	class 
        Program
	{
		static void Main(string[] args)
		{
            int[] V = Array.ConvertAll(Console.ReadLine().ToString().ToArray(), x => (int)x - 48);
            int brojac=0;
			for (int i = 0; i < V.Length; i++) 
			{
                if (V[i] == 0)
                {
                    continue;
                }
                if (V[i] == 1)
				{
					brojac++;
					continue;
				}
				if (V[i] == 2)
				{
					brojac++;
					continue;
				}
				if (V[i] == 3)
				{
					brojac+=2;
					continue;
				}
				if (V[i] == 4)
				{
					brojac += 2;
					continue;
				}
				if (V[i] == 5)
				{
					brojac += 1;
					continue;
				}
				if (V[i] == 6)
				{
					brojac += 2;
					continue;
				}
				if (V[i] == 7)
				{
					brojac += 2;
					continue;
				}
				if (V[i] == 8)
				{
					brojac += 3;
					continue;
				}
				if (V[i] == 9)
				{
					brojac += 2;
					continue;
				}

			}
			Console.WriteLine(brojac.ToString());
			}
  }
	}