Calculate the Perimeter of the figures