#include <iostream>
#include<string>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char** argv) {
	string a;
	cin>>a;
	int h=a.size() ;
	int b=0;
	int i=0;
	//cout<<h<<a[0]<<endl;
	/*for (i=0;i<=h;i++)
	{
		cout<<a[i];
	}*/
		//cout<<a[11]<<endl;
	do
	{
		
		if(a[i]=='1')
		{
			b=b+1;
		}
		if(a[i]=='2')
		{
			b=b+1;
		}
		if(a[i]=='3')
		{
			b=b+2;
		}
		if(a[i]=='4')
		{
			b=b+2;
		}
		if(a[i]=='5')
		{
			b=b+1;
		}
		if(a[i]=='6')
		{
			b=b+2;
		}
		if(a[i]=='7')
		{
			b=b+2;
		}
		if(a[i]=='8')
		{
			b=b+3;
		}
		if(a[i]=='9')
		{
			b=b+3;
		}
		//cout<<b<<endl;
		i++;	
	}
	while(i<=h-1);
	cout<<b;
	return 0;
}