495. Count the Matches. A friend writes that he bought a small box of short matches, each an inch long. He found that he could arrange them in the form of a triangle, the area of which contained as many square inches as there were matches. Then he used 6 matches, and it turned out that from the remaining ones, he could form a new triangle, the area of which contained as many square inches as there were matches left. And after using another 6 matches, he managed to do the same again.

How many matches did he have in the box originally? This number is less than 40.

\section*{VARIOUS PUZZLES}
495. There were 36 matches in the box, from which my friend could form a triangle \((17,10,9)\) with an area of 36 square inches. After using 6 matches, the remaining 30 formed a triangle \((13,12,5)\) with an area of 30 square inches, and using another 6 matches, he was able to form a triangle \((10,8,6)\) with an area of 24 square inches from the remaining 24 matches.