character(len=600)::str integer::prev=-1,len=0,maxlen=0 read *,str do i=1,LEN_TRIM(str) if ( ICHAR(str(i :i )).eq.226 .and. & ICHAR(str(i+1:i+1)).eq.128 .and. & ICHAR(str(i+2:i+2)).eq.166 ) then if( (i-prev.eq.3) .or. (prev.eq.-1)) then prev = i len = len + 1 maxlen = MAX(len, maxlen) else prev = -1 len = 0 end if end if end do print '(i0)', maxlen end program