Suppose Peter can finish painting the fence in x hours. That means he can paint 1/x of the fence in 1 hour, John can paint 1/6 of the fence in 1 hour, and Paul can paint 1/8 of the fence in 1 hour. We can write the following equation:
1/6 + 1/8 + 1/x = 1/2
Solving, we get x = 24/5, so it takes Peter 24/5 hours to paint the fence alone.