n = gets.to_i a_sum = gets.chomp.split.map(&:to_i).inject(:+) p ((n+1)*n/2 - a_sum).abs