P2108 Learning English

Description

To adapt to the intense college study life, Xiao Z decided to review and strengthen his English. Since Xiao Z is fond of math, he started with numerals. Xiao Z spent a whole day and finally understood everything about cardinal numbers. He was very excited and decided to make some problems to quiz Xiao G, who has passed the College English Test Band 4 (CET-4) and is known as an “English master.” The rule is simple: Xiao Z gives the English spelling of an integer $x$, and Xiao D is required to write $x$ in Arabic numerals. Xiao Z guarantees the following: 1. $-999,999,999 \leq x \leq 999,999,999$. 2. Only the following English words will be used in the problem statement: `negative, zero, one, two, three, four, five, six, seven, eight, nine, ten` `eleven, twelve, thirteen, fourteen, fifteen, sixteen, seventeen, eighteen, nineteen, twenty` `thirty, forty, fifty, sixty, seventy, eighty, ninety, hundred, thousand, million` 3. If $x$ is negative, the first word in the problem statement is `negative`; otherwise, the word `negative` will never appear. 4. Because Xiao Z is very confident, he does not know that numbers like $103$ should be written as `one hundred and three` and instead writes `one hundred three`. That is, the word `and` never appears in any of Xiao Z’s problems (even though it normally should). Please understand. 5. Except for point 4, the rest basically follow English grammar; for example, $1500$ is written as `one thousand five hundred` rather than `fifteen hundred`. Upon receiving the problem, Xiao D scoffed: “Trivial! Just write a program...”. But Xiao D is going out to have fun (by now probably thousands of miles away), so this task is left to you.

Input Format

One line, the English representation of $x$ as described in the problem statement.

Output Format

One line, the Arabic numeral form of $x$.

Explanation/Hint

For $100\%$ of the testdata, $-999,999,999 ≤ x ≤ 999,999,999$. Translated by ChatGPT 5