eolymp
bolt
Try our new interface for solving problems
Problems

Smart dog

Smart dog

\begin{verbatim} Come, Jim, give me your paw for luck,I swear i've never seen one like it.Let's go, the two of us, and barkUp the moon when Nature's silent.Come, Jim, give me your pow for luck. (S.Esenin "Kachalov's Dog")\end{verbatim}\includegraphics{https://static.e-olymp.com/content/40/4088e53f27f091f1ef8af70bbdf5c012bb049e49.jpg} As you know, the poet Sergei Esenin and acclaimed actor Vasily Kachalov (real name Shverubovich) friends. With the hero known work Yesenin met when the dog was four months old. Here is a description of their acquaintance he Katchalov: "\textit{At about midnight, I played the show, come home ... A small company of my friends and I sit Esenin ... I climbed the stairs and hear the joyful barking of Jim, the same dog, which then Esenin devoted to poetry. Then Jim was only four months. I went and saw Jim and Esenina - they have already met and sat on the sofa and came close to each other. Esenin with one arm round Jim's neck, while another held his paw and a hoarse deep voice saying: "}\textit{\textbf{What's paw, I've never seen such.}}\textit{" squeaked Jim happily, quickly put out his head from under the arms and Esenina licked his face, and when Esenin read poems, Jim looked closely into his mouth. Esenin Before leaving for a long time shaking his paw: "}\textit{\textbf{Oh, you hell, it is difficult to part with you. I told him today I'll write poetry.}}" According to unconfirmed reports, it was not the last meeting of the poet, actor and dogs. They walked together three times and, in gratitude for his dedicated poems, Jim taught mathematics Sergei, it is no secret that, as a rule, the humanities problems with the sciences - a phenomenon quite common. To the surprise of Sergei, as it turned out much later, Jim operated the numbers in the quaternary number system. Each figure he uttered (Jim did not know how to write because of the biological characteristics of the structure of the organism) certain sound: \begin{itemize} \item \textbf{0} -- \textbf{r}; \item \textbf{1} -- \textbf{g}; \item \textbf{2} -- \textbf{a}; \item \textbf{3} -- \textbf{v}. \end{itemize} Help a great poet to write in the number spoken by Jim usual decimal notation. \InputFile In a single line is uttered by Jim number. The length of the spoken word does not exceed \textbf{100} characters and contains only Latin characters specified in lowercase. \OutputFile The only number in decimal without leading zeroes.
Time limit 1 second
Memory limit 128 MiB
Input example #1
gavrgav
Output example #1
6939
Author Анатолий Присяжнюк
Source Open and Distance Olympiads 2011-2012