Having seen Sasha's skill in solving "tails", Bohdanchik also decided to settle all his debts in mathematics.

In total, he has $n$ tasks, each of which has a specific topic denoted by the number $a_i$.

Because some topics are repeated, Bohdanchik solves them faster, namely:
\begin{itemize}
\item If Bohdanchik solves a task of a certain topic for the first time, he uses $x$ minutes of time.
\item If he solves it not for the first time and the last time he solved this topic he spent $q$ minutes, then this time he will spend $\max(\lfloor \frac{q}{2} \rfloor,1)$ minutes.
\end{itemize}

Find the total time in minutes that he will spend solving the homework.

In the notation, $\lfloor X \rfloor$ means rounding down (to the nearest integer), for example, $\lfloor 3.14 \rfloor = 3$, $\lfloor 3.9 \rfloor = 3$.