program cojs1441;
var
n,x,y,a,b,i:longint;
function max(a,b:longint):longint;
begin
if a>b then exit(a) else exit(b);
end;
begin
assign(input,'FlowerNOIP2013.in');reset(input);
assign(output,'FlowerNOIP2013.out');rewrite(output);
readln(n);
read(y);
for i:=2 to n do
begin
read(x);
if x>y then a:=max(a,b+1);
if x<y then b:=max(b,a+1);
y:=x;
end;
writeln(max(a,b)+1);
close(input);close(output);
end.