If they were painting different houses at the same time,
Sally will have painted one and a half houses in 6 hours,
while John will have painted one.
Hence, they will have painted two and a half houses in 6 hours, while painting at the same time.
That's 5 houses in 12 hours.
So, it will take a fifth of that time to paint one house, working together.