using System;

namespace ConsoleApp11
{
    class Program
    {
        static void Main(string[] args)
        {
            string  a;
            int q = 0;
            int br = 0;
            a = Console.ReadLine();
            char p;
            while (q<a.Length)
            {
                p = a[q];

                if (p == '1' || p == '2' || p == '5') br++;
                if (p == '3' || p == '4' || p == '6' || p == '7' ) br = br + 2;
                if (p== '8' || p == '9') br = br + 3;
                q++;
            }
            

            p = a[1];
            /*if (q == 1 || q == 2 || q == 5) br++;
            if (q == 3 || q == 4 || q == 6 || q == 7) br = br + 2;
            if (q == 8 || q == 9) br = br + 3;*/
     
            Console.WriteLine(br);
            Console.ReadLine();
           
        }
    }
}