#include<iostream>
#include<stdio.h>

using namespace std;

int main()
{
	unsigned long long v;
	unsigned long long br = 0;
	cin >> n;
	int a[15] = {0, 1, 1, 2, 2, 1, 2, 2, 3, 3};
	while(v)
	{
		br += a[v % 10];
		v /= 10;
	}
	
	cout << br;
}