for(h=p=0;s=readline(v='');print(h=v))for(i in s)v+=1-s[i]?' ':+h[i]||+v[i-1]||++p