#include <stdio.h>int main(){ int i, a, b,max=0,min=1000; scanf("%d ", &a); for (i=1; i<=a; i++) { scanf("%d",&b); if(max < b) { max = b; } if(min > b) { min = b; } } printf("%d", max-min);}