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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Unesite sumu novca");
            long v = Convert.ToInt64(Console.ReadLine());
            long a = v;
            int br = 0;
            int zb = 0;
            while (a > 0)
            {
                a /= 10;
                br++;
            }
            for (int i = 0; i < br; i++)
            {
                long m = v % 10;
                v /= 10;
                switch (m)
                {
                    case 1:
                    case 2:
                    case 5:
                        zb += 1;
                        break;
                    case 3:
                    case 4:
                    case 6:
                    case 7:
                        zb += 2;
                        break;
                    case 8:
                    case 9:
                        zb += 3;
                        break;
                    default:
                        Console.WriteLine("greska");
                        break;
                }
            }
            Console.WriteLine(zb);
            Console.ReadLine();
        }
    }
}