for($='';_=readline();)$+=_+'\n' print($.replace(/\./g,function(_,i)[n+=$[i+j]=='*'for each(j in n=0,[-18,-17,-16,-1,1,16,17,18])][7]))