import java.util.Scanner;
import java.util.Stack;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in); // 단순 숫자 입력이므로 Scanner을 이용하여 입력을 받음
Stack<Integer> stack = new Stack<>();
int num = sc.nextInt(); // 들어올 숫자의 개수 입력
for (int i = 0; i < num; i++) {
int height = sc.nextInt();
if (stack.size() == 0) {
stack.push(height);
} else if (stack.peek() <= height) {
while (stack.peek() <= height) {
stack.pop();
if(stack.size()==0)
break;
}
stack.push(height);
} else if (stack.peek() > height) {
stack.push(height);
}
}
System.out.println(stack.size());
}
}