program main implicit none character*5::time integer::h,m,carry read *,time read(time(1:2),'(i2)'),h read(time(4:5),'(i2)'),m if(m.ge.55) then carry = 1 end if m = MOD(m+5,60) h = MOD(h+carry,24) print '(i2.2,":",i2.2)',h,m end program main