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

using namespace std;

int main()
{
    long v;
    scanf("%d",&v);
    int br=0;
    int a;
    while(v!=0)
    {
        a=v%10;
        switch(a)
        {
            default: break;
            case 1: case 2: case 5: br++; break;
            case 3: case 4: case 6: case 7: br += 2; break;
            case 8: case 9: br += 3; break;
        }
        v/=10;
    }
    printf("%d",br);
}