#include<stdio.h> int main(){ int temp,next,priod=0,time=0; while(scanf("%d",&temp)!=EOF && temp){ time=0,priod=0; while(temp--){ scanf("%d",&next); if(next>priod){