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