using C=System.Console;class G{static void Main(){for(;;){int s=0;foreach(char c in C.ReadLine())s+=c>47?397313>>(c-48)*2&3:0;C.WriteLine(s);}}}