def main(): # Read in the information about the set of problems proposed, used = map(int, input().split()) # Store difficulties in a set to remove duplicates difficulties = set(int(input().strip()) for _ in range(proposed)) # We will either have enough difficulties for each problem or the set of # unique difficulties will limit us ans = min(len(difficulties), used) # Print the number of unique difficultes computed print(ans) # Entry point for the main function if __name__ == "__main__": main()