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