Smart dog#2068

Smart dog

1 second
128 megabytes
Easy

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:

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:

Your task: convert Larry's number (given as sounds) into a regular decimal number.

Input

One line containing Larry's number as a sequence of letters (r, g, a, v). The length does not exceed characters.

Output

Print the number in decimal notation, without leading zeros.

Examples

Example 1

Loading
Loading