output_description: Print the minimum number of balls that Takahashi needs to rewrite the integers
  on them.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N K
      A_1 A_2 ... A_N
attempt: N K= map(int, input().split())
  A =list(map(int, input().split()))
  
  Aset =list(set(A))
  B=[0]*len(Aset)
  cnt =0
  
  for i in range(len(Aset)):
    for j in range(len(A)):
      if Aset[i] == A[j]:
        cnt += 1
    B[i] = cnt
    cnt =0
  
  B=sorted(B)[::-1]  
  
  ans =0
  
  for i in range(K,len(B)):
    ans +=B[i]
    
  print(ans) 
problem_description: Statement
  
  Takahashi has N balls. Initially, an integer A_i is written on the i-th ball.
  
  He would like to rewrite the integer on some balls so that there are at most K
  different integers written on the N balls.
  
  Find the minimum number of balls that Takahashi needs to rewrite the integers
  on them.
samples: [{"input": "5 2\n    1 1 2 2 5", "output": "1\n    \n\nFor example, if we rewrite the integer on the fifth ball to 2, there are two\ndifferent integers written on the balls: 1 and 2. On the other hand, it is not\npossible to rewrite the integers on zero balls so that there are at most two\ndifferent integers written on the balls, so we should print 1.\n\n* * *"}, {"input": "4 4\n    1 1 2 2", "output": "0\n    \n\nAlready in the beginning, there are two different integers written on the\nballs, so we do not need to rewrite anything.\n\n* * *"}, {"input": "10 3\n    5 1 3 2 4 1 1 2 3 4", "output": "3"}]