A lifeguard runs at 5 m/s on the beach and swims at 2 m/s in the water. The lifeguard is 40 m downshore from a point on the beach directly opposite a swimmer who is 30 m offshore. The lifeguard runs straight along the beach to a point x metres from the point opposite the swimmer before entering the water and swimming straight to the swimmer. Determine the value of x that minimizes the total rescue time.