John has two pieces of wood. The first piece is 51 inches long and the second piece is 45 inches long. He cuts the shorter length from the longer one. Then he adds a piece that is 40 inches long to the remaining length. What is the new total length of wood that John has?