import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Arrays; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String[] sa = br.readLine().split(" "); int n = Integer.parseInt(sa[0]); int[] a = new int[n]; sa = br.readLine().split(" "); if (sa.length > 1) { System.out.println("assert"); return; } a[0] = Integer.parseInt(sa[0]); a[1] = Integer.parseInt(br.readLine()); a[2] = Integer.parseInt(br.readLine()); int[] b = new int[n]; b[0] = a[0] + a[1]; b[1] = a[0] + a[2]; b[2] = a[1] + a[2]; Arrays.parallelSort(b); if (b[1] == b[2]) { System.out.println(b[0]); } else { System.out.println(b[1]); } } }