#include<iostream>
#include<cstring>
#include<cstdio>
#include<cstdlib>
using namespace std;
int n;
int ans;
int a[100010];
int flag=-1;
int main(){
freopen("flower.in","r",stdin);
freopen("flower.out","w",stdout);
scanf("%d",&n);
for(int i=1;i<=n;i++){
scanf("%d",&a[i]);
}
for(int i=1;i<=n;i++){
if(a[i]>a[i+1]&&i+1<=n){
if(flag==1||flag==-1){
ans++;
flag=0;
}
}
if(a[i]<a[i+1]&&i+1<=n){
if(flag==0||flag==-1){
ans++;
flag=1;
}
}
}
printf("%d",ans+1);
return 0;
}