To organize the olympiad, the organizers plan to connect the participants' computers in a network. They have switches and an unlimited number of network cables. Switch number (1 \leq i \leq N) has a_i ports.
Cables can be used to connect two switches, two computers, or a switch and a computer. Each switch can be connected by cables to at most a_i devices (switches or computers), and each computer can be connected to at most one device.
Two computers can communicate if there is a cable path from one to the other, possibly passing through a chain of switches. The organizers want to build a network in which any two computers can exchange data.
What is the maximum number of computers that can be connected in the network using the available switches?
The first line contains one integer (0 \leq N \leq 10^5). The second line contains integers a_i (1 \leq a_i \leq 10^9, 1 \leq i \leq N).
Output a single integer — the maximum number of computers that can be connected in the network using the available switches.
Example 1