A square region \(ABCD\) is externally tangent to the circle with equation \(x^2+y^2=1\) at the point \((0,1)\) on the side \(CD\). Vertices \(A\) and \(B\) are on the circle with equation \(x^2+y^2=4\). The side length of this square can be expressed in the form \(\frac{k\sqrt{m}-n}{p}\), where \(\sqrt{m}\) is a square root of a prime number. Find the value of \(k + m + n + p\).

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