n = gets.to_i - 1 vs = (0...n).map { gets.split.map(&:to_i) } .transpose.map(&:sum).sort puts vs[1] - (vs[1] - vs[0]) + 1