Determine when .

Cosine is zero at for all integers . So, . Solving for , we find . So, in a single day, at . Next, consider intervals when . We don't care about or . We just care about . Plug in one value for in each interval and if at that value, that will be the case for the whole interval. Similarly for .

So, at , , so on the whole interval .

Next, try : , so on the whole interval .

Next, try : , so on the whole interval .

So, among the intervals when surfing is allowed, are the only intervals that allow for surfing. So, it is allowed for 5 hours, as you found.