The sides of the triangles are whole numbers. Given that the triangles are right triangles, from the converse of the pythagorean theorem we know that the sides must be such that `a^2+b^2=c^2` , where a,b,c are the sides and c is the longest side.
Numbers that obey this property are called pythagorean triples. Examples include 3-4-5, 5-12,-13, 7-24,25, 8-15-17. We are looking for a triple, or a multiple of a triple, such that two different triangles can be formed. Since we want the smallest number, it seems a good idea to look at the smallest triples and their multiples.
The perimeters of the examples given are : 3-4-5 =>12,5-12-13 =>30,7-24-25 => 56,8-15-17 =>40
Consider 12 and 30; the least common multiple of 12 and 30 is 60. Thus we could form a right triangle with perimeter 60 that was similar to a 3-4-5 triangle, 15-20-25. Or we could form a right triangle similar to a 5-12-13; 10-24-26.
Thus 60 is the smallest number of matches required.