A domino is a rectangular piece of size 2×1, and each of its two squares carries a number from 1 to 6. Dominoes are normally used to play a game, but here they are used for something else.
You can place dominoes without overlaps and without gaps to fill a rectangle of width W and height 3. The goal is to count how many such fillings exist. The numbers printed on the pieces play no role, so two fillings count as different when the position or the orientation of at least one domino differs.
The figure below shows the three ways of filling a rectangle of width 2 and height 3.

A larger width admits many more fillings. For example, one possible answer for width 12 is this one.

Write a program that computes the number of ways to tile a rectangle of width W and height 3 with dominoes.