import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int aSum = 0; int bSum = 0; for (int i = 0; i < n - 1; i++) { aSum += sc.nextInt(); bSum += sc.nextInt(); } int max = Math.max(aSum, bSum); int min = Math.min(aSum, bSum); int ans = max - (max - min) + 1; System.out.println(ans); } }