CF1008C Reorder the Array

题目描述

**题目大意:** 给定一个序列,序列里的元素可以以任意顺序重新排好 序列里某位置排序后的数可能会大于原数,问这样的位置最多能有多少个

输入格式

第一行一个整数$n$,表示序列长度 第二行$n$个整数,表示初始序列

输出格式

一个整数,表示满足条件的位置最多能有多少个

说明/提示

In the first sample, one of the best permutations is $ [1, 5, 5, 3, 10, 1, 1] $ . On the positions from second to fifth the elements became larger, so the answer for this permutation is 4. In the second sample, there is no way to increase any element with a permutation, so the answer is 0.