#include<stdio.h>
#include<stdlib.h>
#include<iostream>
using namespace std;
int main()
{
	long long V;
	int br=0,x;
	scanf("%d",&V);
	while(V>0)
	{
		x=V%10;
		if(x==1 || x==2 || x==5)
		br++;
		else if(x==3 || x==4 || x==6 || x==7)
		br=br+2;
		else if(x==8 || x==9)
		br=br+3;
		V=V/10;
	}
	printf("%d",br);
	return 0;
}