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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string broj =Console.ReadLine();
            char[]niz = broj.ToCharArray();
            int s = 0;
            for (int i = 0; i < niz.Length; i++)
            {
                if (niz[i] == '1') s += 1;
                if (niz[i] == '2') s += 1;
                if (niz[i] == '3') s += 2;
                if (niz[i] == '4') s += 2;
                if (niz[i] == '5') s += 1;
                if (niz[i] == '6') s += 2;
                if (niz[i] == '7') s += 2;
                if (niz[i] == '8') s += 3;
                if (niz[i] == '9') s += 3;                
            }
            Console.WriteLine(s);
        }
    }
}