Given the price of a stock on each day, choose one day to buy and a later day to sell to maximise profit. If no profit is possible, the answer is 0.
Input: one line of space-separated prices. Output: the maximum profit.
Your program reads from stdin and prints to stdout.
Example 1
Input: 7 1 5 3 6 4
Output: 5
Hints