Boat has to cross a river as soon as possible, but there is a possible obstacle in doing so. It takes 4 seconds less than if it travels by the shortest path. How long does it take for the boat to cross the river?