program main implicit none integer n integer,allocatable,dimension(:)::t integer::wrong=0,collect=0 character s*100,mu*100 integer i read(*,*)n allocate(t(n)) do i=1,n read(*,*)t(1),s if(len_trim(s)>(12*t(1)/1000))then collect=collect+12*t(1)/1000 wrong=wrong+len_trim(s)-12*t(1)/1000 else collect=collect+len_trim(s) endif s(1:100)=mu(1:100) enddo write(*,*)collect,wrong end program main