#include <iostream>
#include <cstring>

using namespace std;

int main(int argc, char** argv) {
	int r=0,k,i,l;
	string s;
	getline(cin,s);
	l=s.length();
	for(i=0;i<l;i++)
	{
		if(s[i]<'0' || s[i]>'9') continue;
		k=(int)(s[i]-'0');
		r+=k/5;
		k%=5;
		r+=k/2;
		k%=2;
		r+=k;
	}
	cout<<r<<endl;
	return 0;
}