The area of each square is in the given figure is 4 cm2. Find the perimeter of the whole figure in cm.