fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|i| i.parse().ok().unwrap())
        .collect()
}

fn main() {
    let n: usize = read();
    let ps: Vec<usize> = read_vec();

    let mut min: usize = n;
    let mut count: usize = 0;

    for p in ps.iter() {
        if min >= *p {
            count += 1;
        }
        min = std::cmp::min(min, *p);
    }
    println!("{}", count);

}