  The arithmetic complexity counts the number of algebraically independent
entries in the periodic continued fraction $\theta=[b_1,\dots, b_N,
\overline{a_1,\dots,a_k}]$. If $\mathscr{A}_{\theta}$ is a noncommutative torus
corresponding to the rational elliptic curve $\mathscr{E}(K)$, then the rank of
$\mathscr{E}(K)$ is given by a simple formula $r(\mathscr{E}(K))=
c(\mathscr{A}_{\theta})-1$, where $c(\mathscr{A}_{\theta})$ is the arithmetic
complexity of $\theta$. We prove that $c(\mathscr{A}_{\theta})$ is equal to the
dimension of the Brock-Elkies-Jordan variety of $\theta$ introduced in [1].
Following Zagier and Lemmermeyer, we evaluate the Shafarevich-Tate group of
$\mathscr{E}(K)$.
