program main implicit none integer(8) a,b,c read(*,*)a,b,c if(60*a-b<=0)then write(*,*)-1 else if(mod(3600*c,(60*a-b))==0)then write(*,*)3600*c/(60*a-b) else write(*,*)3600*c/(60*a-b)+1 endif endif end program main