#include <iostream>

using namespace std;
string s;
int br;
int main() {
cin>>s;
for (int i=0;i<=s.size();i++){
  if (s[i]=1) br++;  

if (s[i]==2) br++;
if (s[i]==3) br+=2;
if (s[i]==4) br+=2;
if (s[i]==5) br++;
if (s[i]==6) br+=2;
if (s[i]==7) br+=2;
if (s[i]==8) br+=3;
if (s[i]==9) br+=3;

}
cout<<br;

 return 0;   
}