A square is inscribed in an isosceles right triangle. Length of the leg equals to 2 in. as shown on the figure. Find the perimeter of the square.