implicit none integer::N,i character*(6*10**5)::L integer::total(0:6),max,indx data total/7*0/ read *,N read '(a)',L do i=1,2*N-1,2 indx = ICHAR(L(i:i))-ICHAR('0') total(indx) = total(indx) + 1 end do print *, total max = MAXVAL(total) do i=6,1,-1 if(max.eq.total(i)) then print '(i0)', i return end if end do end program