<filename>jp.atcoder/abc064/abc064_b/8252445.py
import sys

input = sys.stdin.readline

N = int(input())
a = [int(a) for a in input().split()]
a.sort()
print(a[-1] - a[0])

<filename>jp.atcoder/abc064/abc064_b/8252445.py
import sys

input = sys.stdin.readline

N = int(input())
a = [int(a) for a in input().split()]
a.sort()
print(a[-1] - a[0])
