#K71902. Santa's Maximum Delivery Time

    ID: 33634 Type: Default 1000ms 256MiB

Santa's Maximum Delivery Time

Santa's Maximum Delivery Time

Santa is delivering gifts to n houses. Each house becomes inaccessible (blocked) after a given number of minutes, specified in an array of blocking times. Santa can only deliver gifts as long as all houses are accessible. Hence, his maximum delivery time is determined by the house that gets blocked the earliest, i.e. the minimum among the provided blocking times.

Your task is to compute the maximum number of minutes Santa can continue his delivery before any house becomes blocked.

Note: The input will be provided via standard input and the output should be printed to standard output.

inputFormat

The first line of input contains an integer n — the total number of houses.

The second line contains n space-separated integers representing the blocking times for each house.

You should read input from stdin.

outputFormat

Output a single integer representing the maximum number of minutes Santa can continue delivering gifts before being blocked.

Your answer should be printed to stdout.

## sample
6
8 4 7 5 10 15
4