#include <iostream>
using namespace std;
int main()
{
long long v,vv;
int brnovc=0;
cin>>v;
vv=v;
while(v>0)
{
    vv=v%10;
    if(vv==1)
    brnovc=brnovc+1;
    if(vv==2)
    brnovc=brnovc+1;
    if(vv==3)
    brnovc=brnovc+2;
    if(vv==4)
    brnovc=brnovc+2;
    if(vv==5)
    brnovc=brnovc+1;
    if(vv==6)
    brnovc=brnovc+2;
    if(vv==7)
    brnovc=brnovc+2;
    if(vv==8)
    brnovc=brnovc+3;
    if(vv==9)
    brnovc=brnovc+3;
    v=v/10;

}
cout<<brnovc;
    return 0;
}