#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    ll n,ans[10]={0,1,1,2,2,1,2,2,3,3};
    cin>>n;
    ll sol=0;
    while(n) sol+=ans[n%10],n/=10;
    cout<<sol;
    return 0;
}