https://cses.fi/paste/b08757275bc1f3fcab886/
#4n=int(input())lst=list(map(int,input().split()))count=0for i in range(1,n):t=lst[i]-lst[i-1]if t<0:count+=(-1*t)lst[i]=lst[i-1]print(count)
https://cses.fi/paste/b08757275bc1f3fcab886/
#4n=int(input())lst=list(map(int,input().split()))count=0for i in range(1,n):t=lst[i]-lst[i-1]if t<0:count+=(-1*t)lst[i]=lst[i-1]print(count)