#include <iostream>

using namespace std;
int main() {
    long long br;
    cin>>br;
    long long p=br;
    int d=0, r=0, n;
    while(p>0)
	{
		p/=10;
    	d++;
	}
	int c[d];
	n=d-1;
	while(br>0)
	{
		c[n]=br%10;
		br/=10;
		n--;
	}
	while(n<d)
	{
		switch(c[n])
		{
			case 0:break;
			case 1: r++;  break;
			case 2: r++;  break;
			case 3: r+=2; break;
			case 4: r+=2; break;
			case 5: r++;  break;
			case 6: r+=2; break;
			case 7: r+=2; break;
			case 8: r+=3; break;
			case 9: r+=3; break;
		}
		n++;
	}
	cout<<r;
    return 0;
}