import Data.List main=do getLine getLine m<-getContents>>=return.sort.map (read::String->Int).lines print$last m - head m