P24937 [AtCoder] [ARC019A] Shopping Crisis
入门
题目描述

Problem Description

I am currently playing a role-playing game called Ancient Royal Coders by a company named ARC Games, where you can learn competitive programming skills while adventuring.

However, the game has just started, and I am about to head to the first dungeon. First, I should go to the shop in the town to buy some herbs.

Upon arriving at the shop and checking the price of the herbs, it seems odd. The price displayed on the screen is 1Z0 gold, but is this really $ 120 $?

Upon inspecting other items, it turns out that some digits have been replaced with similar-looking alphabets! This could lead to the price being interpreted as a base-36 number, resulting in an exorbitant amount!

So, to avoid being overcharged, I need to write a program to convert this strange notation back to the correct notation consisting only of digits. This game is quite challenging from the start. After some investigation, it seems the replaced characters are as follows:

  • O → 0
  • D → 0
  • I → 1
  • Z → 2
  • S → 5
  • B → 8

Let's get started on writing the program for this.

Input Format

The input is given from the standard input in the following format:

$ S $

  • The first line contains the price displayed on the screen, $ S $.
  • $ S $ is a string of 1 to 8 characters, consisting of the characters 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, O, D, I, Z, S, B.
  • The first character of $ S $ is not 0, O, or D.

Output Format

Output the correct price consisting only of digits in one line.

Ensure to include a newline at the end of the output.

Sample Input and Output

Sample Input #1

1Z0

Sample Output #1

120

Sample Input #2

4ZD6O

Sample Output #2

42060

Sample Input #3

BI9Z

Sample Output #3

8192

Notes/Hints

Sample Explanation 1

Replacing Z with the corresponding 2 reveals that the correct price is $ 120 $ gold. As seen from this example, not all 1s are necessarily replaced with I.

Sample Explanation 2

Both O and D correspond to 0.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
1Z0
样例输出
120