'not a statement'
package pl.codegym.task.task05.task0532;
import java.io.*;
/*
Zadanie z algorytmami
*/
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int maksimum;
int n = Integer.parseInt(reader.readLine());
if (n<0) {
break;
} else
{
for (int i = 0; i<n; i++) {
int 2n = Integer.parseInt(reader.readLine());
if (2n<maksimum) {
maksimum = 2n;
}
}
}
//tutaj wpisz swój kod
if (n>=0){
System.out.println(maksimum);
}
}