Alice and Bob are working together to paint a fence. Alice can paint the entire fence by herself in 6 hours, while Bob can paint the entire fence by himself in 9 hours. They start painting together, but Bob takes a break after some time, leaving Alice to finish the remaining work alone. If the total time taken to paint the fence is 5 hours, how long did Bob work before taking a break? Let's think step by step and output the final answer within \boxed{}.
user