#include <bits/stdc++.h>

using namespace std;

int main()
{
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    long long v;
    cin>>v;
    int n = 0;
    int k = 0;
    while(v != 0)
    {
    	k = v % 10;
		switch(k)
		{
			case 0: break;
			case 1: n += 1; break;
			case 2: n += 1; break;
			case 3: n += 2; break;
			case 4: n += 2; break;
			case 5: n += 1; break;
			case 6: n += 2; break;
			case 7: n += 2; break;
			case 8: n += 3; break;
			case 9: n += 3; break;
		}	
		v = v / 10;
	}
	cout<<n;
}