using System;
class Program
{
    static void Main(string[] args)
    {
        int n,d=10,br,i=0;
        int []b=new int[2147483647];
        n=int.Parse(Console.ReadLine());
        while(n/d>0)
        {
            b[i]=n%d;
            n/=d;
            if(b[i]==1 || b[i]==2 || b[i]==5)
                br++;
            if(b[i]==3 || b[i]==4 || b[i]==6 || b[i]==7)
                br+=2;
            if(b[i]==8 || b[i]==9)
                i+=3;
            d*=10;
            i++;
        }
        Console.WriteLine(f);
    }
}