#K13161. Count Named Entities

    ID: 23852 Type: Default 1000ms 256MiB

Count Named Entities

Count Named Entities

In this problem, you are given a string that may contain several named entities wrapped in HTML-like tags. The named entities are defined as follows:

  • People: Enclosed in <person>...</person> tags.
  • Places: Enclosed in <place>...</place> tags.
  • Dates: Enclosed in <date>...</date> tags.

Your task is to count the number of occurrences of each type of entity in the given string and print the counts. The answer should be printed in the order: number of people, number of places, number of dates, separated by a space.

All regular expressions, if used in your solution, must follow the LaTeX format for mathematical expressions (e.g., <person>.?</person><person>.*?</person>).

inputFormat

The input is provided via standard input (stdin) as a single string. The string can contain spaces, punctuation, and any of the specified tags for named entities. It may span multiple lines.

outputFormat

The output should be printed to standard output (stdout) as three integers separated by a space. These integers represent the counts of tags, tags, and tags respectively.## sample

Hello John Doe, welcome to New York. Your appointment is on 15th September.
1 1 1