Computing the perimeter of a triangle