Skip to content
UPEEC

Parse an Integer

Easy#strings#parsing· solved by 0 · time limit 2.0 s

Convert the text to an integer without using your language's built-in conversion. The text may have spaces around it and an optional + or -. If anything else appears, print Invalid.

Input

One line of text.

Output

The integer or Invalid.

Constraints

At most 15 characters.

Sample 1

Input

  -42  

Output

-42

Sample 2

Input

4193 words

Output

Invalid

Sign in or join free to run and submit your solution.