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

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