We are given a series of similar triangles with areas $1^2, 3^2, 5^2, \ldots, 49^2$. If the smallest triangle has a perimeter of 4, what is the sum of the perimeters of all the triangles?

Let's think step by step and output the final answer within \boxed{}.
user