A smart dog named Larry knows how to count! But he counts in a special way using sounds instead of regular numbers.
Larry uses four different sounds to represent digits:
r means 0
g means 1
a means 2
v means 3
Larry counts in base-4 (quaternary system). This means each position is worth 4 times more than the position to its right, just like in our regular system where each position is worth 10 times more.
For example:
"g" = in decimal
"gr" = 1 \times 4 + 0 = 4 in decimal
"ga" = 1 \times 4 + 2 = 6 in decimal
Your task: convert Larry's number (given as sounds) into a regular decimal number.
One line containing Larry's number as a sequence of letters (r, g, a, v). The length does not exceed characters.
Print the number in decimal notation, without leading zeros.
Example 1