Run id: 105864

------Input------
5 888 888 999 999 3
------Answer-----
888
------Your output-----
3