program main character(len=600)::str character(3),parameter::silence=CHAR(226)//CHAR(128)//CHAR(166) integer,parameter::undef=-2 integer::prev=undef,len=0,maxlen=0,diff read *,str do i=1,LEN_TRIM(str) if ((i-prev).eq.2) cycle if ( str(i:i+2) .eq. silence ) then diff = i-prev prev = i if( diff.eq.3 ) then len = len + 1 maxlen = MAX(len, maxlen) else if(diff.gt.3) then len = 1 end if end if end do print '(i0)', maxlen end program main