The sides of right triangles form pythagorean triples -- numbers a,b, and c such that `a^2+b^2=c^2` .
The smallest primitive triples (numbers that are relatively prime or share no common factors other than 1) are 3-4-5 and 5-12-13. The perimeter of a 3-4-5 triangle is 12 units, and the perimeter of a 5-12-13 triangle is 30 units.
The least common multiple of 12 and 30 is 60. We can form two right triangles with perimeter 60 units:
15-20-25 and 10-24-26. Note that `15^2+20^2=225+400=625=25^2` and `10^2+24^2=100+576=676=26^2` so these are both right triangles.
Thus the smallest number of matches required is 60.