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

namespace ConsoleApp3
{
    class Program
    {
        static void Main(string[] args)
        {
            ulong v = ulong.Parse(Console.ReadLine());
            int s = 1;
            int n = 1;
            int x;
            int a = 0;
            while (s != 0)
            {
                s = (int)(v / (ulong)Math.Pow(10, n));
                n++;
            }
            for (int i = 0; i < n - 1; i++)
            {
                x = (int)(v / (ulong)Math.Pow(10, i) % 10);
                if (x == 1 || x == 2 || x == 5) a++;
                else if (x == 3 || x == 4 || x == 6 || x == 7) a = a + 2;
                else if (x == 8 || x == 9) a = a + 3;
            }
            Console.WriteLine(a);
        }
    }
}