#include<bits/stdc++.h>
using namespace std;

int main(){
	long long a;
	short b=0;
	cin >> a;
	while(a>0)
	{
		switch (a%10)
		{
			case 1: case 2: case 5: b+=1; break;
			case 3: case 4: case 6: case 7: b+=2; break;
			case 8: case 9: b+=3; break;
		}
		a/=10; 
	}
	cout << b;
}