Smart dog
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")
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: "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: "What's paw, I've never seen such." 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: "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:
0 – r;
1 – g;
2 – a;
3 – v.
Help a great poet to write in the number spoken by Jim usual decimal notation.
Input
In a single line is uttered by Jim number. The length of the spoken word does not exceed 100 characters and contains only Latin characters specified in lowercase.
Output
The only number in decimal without leading zeroes.