main=interact$concatMap f.lines.(++"\n");f x=' ':show(g 0 0 x);g 0 n (x:xs)|x=='|'=g 0(n+1)xs|0<1=g 1 n xs;g 1 n (x:xs)|x=='|'=g 0(n+1)xs|0<1=n