Program Dales; Uses Math; Const MaxN=1000000; Var f: Text; N, i: LongInt; c: Array [1..MaxN] of Char; a0, a1: LongInt; cp, cm, rez: LongInt; Begin Assign(f, 'dales.in'); Reset(f); Readln(f, N); Read(f, a1); For i:= 1 To N-1 Do Begin a0:= a1; Read(f, a1); If a0a1 Then c[i]:= '-' Else { a0=a1 } c[i]:= '='; End; Close(f); Assign(f, 'dales.out'); Rewrite(f); rez:= 0; i:= 1; Repeat While (i'+') Do Begin Inc(i); End; If i>=N Then Break; cp:= 0; While (i=N Then Break; While (i=N); Write(f, rez); rez:= 0; i:= 1; Repeat While (i<=N) and (c[i]<>'-') Do Begin Inc(i); End; If i>N Then Break; cm:= 0; While (i<=N) and (c[i]='-') Do Begin Inc(i); Inc(cm); End; cp:= 0; If i>N Then Break; While (i<=N) and (c[i]='+') Do Begin Inc(i); Inc(cp); End; rez:= max (rez, min(cm, cp)); Until (i>N); Writeln(f, ' ', rez); Close(f); End.