#include <bits/stdc++.h>

using namespace std;

main ()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    string s;
    cin >> s;

    int output =0;

    for (int i=0; i<s.length(); i++)
    {
        if (s[i]=='1') output++;
         if (s[i]=='2') output++;
          if (s[i]=='3') output+=2;
           if (s[i]=='4') output+=2;
            if (s[i]=='5') output++;
             if (s[i]=='6') output+=2;
              if (s[i]=='7') output+=2;
               if (s[i]=='8') output+=3;
                if (s[i]=='9') output+=3;
    }

    cout << output;
}