N = gets.to_i A = gets.split.map(&:to_i) puts A.max - A.min + 1