var c:char;n:byte;begin repeat repeat read(c);n:=n+pos(c," 0698")div 3until eoln;writeln(n);n:=0until 0>0end.