character(len=1000000)::str integer::num(ICHAR('a'):ICHAR('z')) integer::t,r,e,i data t,r,e/0,0,0/ data num/26*0/ read *, str do i=1,LEN_TRIM(str) num(ICHAR(str(i:i))) = num(ICHAR(str(i:i))) + 1 end do t = num(ICHAR('t')) r = num(ICHAR('r')) e = num(ICHAR('e')) print '(i0)', MINVAL((/t,r,e/2/)) end program