#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ memset(int *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n, i;
  int maxNumIndex, maxNumCount;
  scanf("%d", &n);
  int *arr = (int *)malloc(sizeof(int) * 100);
  memset(arr, 0, 100);
  maxNumIndex = -1;
  maxNumCount = -1;
  for (i = 0; i < n; i++) {
    int p;
    scanf("%d", &p);
    arr[p - 1]++;
    if (arr[p - 1] > maxNumCount) {
      maxNumCount = arr[p - 1];
    }
  }
  printf("%d", n - maxNumCount);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
mov    $0x190,%edi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1040 <memset@plt>
movl   $0xffffffff,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1203 <main+0xc3>
lea    0xe5b(%rip),%rdi
lea    -0x24(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x20(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
add    $0x1,%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x20(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x14(%rbp),%eax
jle    11f0 <main+0xb0>
mov    -0x20(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
jmp    11f5 <main+0xb5>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1192 <main+0x52>
mov    -0x8(%rbp),%esi
sub    -0x14(%rbp),%esi
lea    0xdf0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xead(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1060 <scanf@plt>
mov    $0x190,%edi
call   1050 <malloc@plt>
mov    %rax,%r12
xor    %ebp,%ebp
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1040 <memset@plt>
mov    0xc(%rsp),%esi
mov    $0xffffffff,%ebx
test   %esi,%esi
jle    11d0 <main+0x90>
lea    0xe71(%rip),%r14
lea    0x8(%rsp),%r15
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
mov    %r15,%rsi
call   1060 <scanf@plt>
movslq 0x8(%rsp),%rax
addl   $0x1,-0x4(%r12,%rax,4)
movslq 0x8(%rsp),%rax
mov    -0x4(%r12,%rax,4),%eax
cmp    %ebx,%eax
cmovg  %eax,%ebx
add    $0x1,%ebp
mov    0xc(%rsp),%esi
cmp    %esi,%ebp
jl     11a0 <main+0x60>
sub    %ebx,%esi
lea    0xe27(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
store i32 0, i32* %1
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%9 = call i64 @malloc(i32 400)
%10 = inttoptr i64 %9 to i32*
store i32* %10, i32** %6
%11 = load i32*, i32** %6
%12 = call i32 @memset(i32* %11, i32 0, i32 100)
store i32 -1, i32* %4
store i32 -1, i32* %5
store i32 0, i32* %3
br label %13
13: ; preds = %42, %0
%14 = load i32, i32* %3
%15 = load i32, i32* %2
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %45
17: ; preds = %13
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %7)
%19 = load i32*, i32** %6
%20 = load i32, i32* %7
%21 = sub nsw i32 %20, 1
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i32, i32* %19, i64 %22
%24 = load i32, i32* %23
%25 = add nsw i32 %24, 1
store i32 %25, i32* %23
%26 = load i32*, i32** %6
%27 = load i32, i32* %7
%28 = sub nsw i32 %27, 1
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i32, i32* %26, i64 %29
%31 = load i32, i32* %30
%32 = load i32, i32* %5
%33 = icmp sgt i32 %31, %32
br i1 %33, label %34, label %41
34: ; preds = %17
%35 = load i32*, i32** %6
%36 = load i32, i32* %7
%37 = sub nsw i32 %36, 1
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds i32, i32* %35, i64 %38
%40 = load i32, i32* %39
store i32 %40, i32* %5
br label %41
41: ; preds = %34, %17
br label %42
42: ; preds = %41
%43 = load i32, i32* %3
%44 = add nsw i32 %43, 1
store i32 %44, i32* %3
br label %13
45: ; preds = %13
%46 = load i32, i32* %2
%47 = load i32, i32* %5
%48 = sub nsw i32 %46, %47
%49 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %48)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%5 = call i64 @malloc(i32 400)
%6 = inttoptr i64 %5 to i32*
%7 = call i32 @memset(i32* %6, i32 0, i32 100)
%8 = load i32, i32* %1
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %32
10: ; preds = %0
%11 = bitcast i32* %2 to i8*
br label %12
12: ; preds = %10, %12
%13 = phi i32 [ 0, %10 ], [ %29, %12 ]
%14 = phi i32 [ -1, %10 ], [ %28, %12 ]
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%16 = load i32, i32* %2
%17 = add nsw i32 %16, -1
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i32, i32* %6, i64 %18
%20 = load i32, i32* %19
%21 = add nsw i32 %20, 1
store i32 %21, i32* %19
%22 = load i32, i32* %2
%23 = add nsw i32 %22, -1
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i32, i32* %6, i64 %24
%26 = load i32, i32* %25
%27 = icmp sgt i32 %26, %14
%28 = select i1 %27, i32 %26, i32 %14
%29 = add nuw nsw i32 %13, 1
%30 = load i32, i32* %1
%31 = icmp slt i32 %29, %30
br i1 %31, label %12, label %32
32: ; preds = %12, %0
%33 = phi i32 [ -1, %0 ], [ %28, %12 ]
%34 = phi i32 [ %8, %0 ], [ %30, %12 ]
%35 = sub nsw i32 %34, %33
%36 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %35)
ret i32 0
}