Let the three sides of a triangle be $\ell, m, n$, respectively, satisfying $\ell > m > n$ and $\{\frac{3^\ell}{10^4}\} = \{\frac{3^m}{10^4}\} = \{\frac{3^n}{10^4}\}$, where $\{x\} = x - \lfloor{x}\rfloor$ and $\lfloor{x}\rfloor$ denotes the integral part of the number $x$. Find the minimum perimeter of such a triangle.

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