integer::i,c,w,mincww character*100::S data c,w,mincww/0,0,101/ read *,S do i=1,LEN_TRIM(S) if(S(i:i).eq.'c') then c = i w = 0 else if (S(i:i).eq.'w') then if (w.ne.0) then mincww = MIN(mincww, i-c+1) c = 0 w = 0 else w = i end if end if end do if (mincww.eq.101) then print '(a)',"-1" else print '(i0)',mincww end if end