import strutils, sequtils var N, a = stdin.readLine.split.map parseInt cnt, ttl = 0 for i, a_i in a: if a_i < cnt: ttl += 1 else: cnt = max(cnt, a_i) echo ttl