using System;

namespace verseny1
{
    class Program
    {
        static void Main(string[] args)
        {
            string inp = Console.ReadLine();
            int count = 0;
            for (int i = 0; i < inp.Length; i++)
            {
                switch(inp[i])
                {   case '1' : count += 1; break;
                    case '2' : count += 1; break;
                    case '3' : count += 2; break;
                    case '4' : count += 2; break;
                    case '5' : count += 1; break;
                    case '6' : count += 2; break;
                    case '7' : count += 2; break;
                    case '8' : count += 3; break;
                    case '9' : count += 3; break;
                }
            }
            Console.WriteLine(count);
        }
    }
}