#include <stdio.h>
#include <stdlib.h>

int main()
{
    unsigned long long int V;
    int minnov=0;
    scanf("%llu",&V);
    while(V>0)
    {
        switch(V%10)
        {
            case 8:case 9: minnov++;
            case 7:case 6: case 4: case 3: minnov++;
            case 1: case 2: case 5: minnov++;
            case 0: break;
        }
        V/=10;
    }
    printf("%d",minnov);
}