calculate the length of a board