fork(1) download
  1. n = int(input())
  2. t = map(int,input().split())
  3. lst = sorted(t)
  4. print(len(set(range(lst[0], lst[-1])) - set(lst)))
  5.  
Success #stdin #stdout 0.02s 9288KB
stdin
5
7 5 6 4 8
stdout
0