first = input() firstdata = first.split(" ") tesagyo = int(firstdata[0])*60 progtime = int(firstdata[1]) progmake = int(firstdata[2]) result = 0 if tesagyo > progtime: result = int((progmake/int(tesagyo-progtime))*3600)+1 else: result = -1 print(result)