Problem 15. Painting

A fence consists of 20 boards. Each is to be painted in blue, green or yellow, and any two adjacent boards must have different colours. In how many ways can the fence be painted?