import java.io.PrintStream;
import java.util.Arrays;
import java.util.Scanner;

/**
 * Solution to Call for Problems, Round 2
 * 
 * @author vanb
 */
public class call2_vanb
{
    /** Input. */
    private static Scanner sc;
    
    /** Output. */
    private static PrintStream ps;
    
    /**
     * Do it!
     */
    private void doit()
    {
        int n = sc.nextInt();
        int k = sc.nextInt();
        
        int count = 0;
        boolean used[] = new boolean[51];
        Arrays.fill( used, false );
        
        for( int i=0; i<n; i++ )
        {
            int d = sc.nextInt();
            if( !used[d] ) ++count;
            used[d] = true;
        }
        
        ps.println( Math.min( k, count ) );
    }
        
    /**
     * Main.
     * 
     * @param args unused
     * @throws Exception
     */
    public static void main( String[] args ) throws Exception
    {
        sc = new Scanner( System.in );
        ps = System.out;
        
        new call2_vanb().doit();
    }

}
