use std::{cmp::max, io::stdin}; fn main() { let N = input().parse::(); let A = input().split_whitespace().map(|t| t.parse::().unwrap()).collect::>(); let mut mx = 0; let mut c = 0; for a in A { if a < mx { c += 1; } mx = max(mx, a); } println!("{}", c); } fn input() -> String { let mut buf = String::new(); stdin().read_line(&mut buf).unwrap(); buf.trim().to_string() }