#K56907. Count Distinct Flowers

    ID: 30302 Type: Default 1000ms 256MiB

Count Distinct Flowers

Count Distinct Flowers

You are given a list representing a garden where each flower is described by a string containing its type and color. Your task is to determine the number of distinct flower descriptions.

For example, if the input list is ["rose red", "tulip yellow", "rose white", "rose red"], the distinct flowers are "rose red", "tulip yellow", and "rose white", leading to an answer of 3.

Note: The input begins with an integer nn representing the number of flowers, followed by nn lines each containing a flower description.

inputFormat

The input is provided via standard input (stdin) in the following format:

  • The first line contains an integer nn, the number of flowers.
  • The following nn lines each contain a string representing a flower's type and color.

outputFormat

Output a single integer to standard output (stdout), indicating the number of distinct flower descriptions.## sample

6
rose red
tulip yellow
rose white
rose red
daisy pink
tulip yellow
4