Under construction

Still being built. Things may change

Gift Expiration Date

Time limit1sMemory limit1024 MB

Summary
Count how many gift cards have an expiration date later than the current date, with dates in YYYY-MM-DD form and no leap years.
Level

Easy2 of 10

Topics
Implementation, String
Solved
No attempts yet

Problem

Ims received gift cards from several people. Ims wants to check how many of the gift cards received so far can be used now. Help Ims by finding the total number of gift cards that can be used at the current date. Only gift cards whose expiration date is after the current date can be used.

Given the expiration dates of the NN gift cards Ims received, find the number of gift cards Ims can use now. Dates are given in the format YYYY-MM-DD, and leap years are not considered in this problem. In other words, February always has only 28 days, regardless of the year.

Input

The first line contains the current date.

The second line contains the number of gift cards Ims received, N(1≤N≤100)N(1 \leq N \leq 100).

From the third line, the next NN lines contain the expiration dates of the gift cards Ims received.

The years are given only from 18001800 to 20232023.

Output

Print the number of gift cards Ims can use now.

Examples3

  1. Example 1

    Input
    2022-12-12
    2
    2022-12-12
    2023-12-12
    
    Expected output
    2
    
  2. Example 2

    Input
    2022-11-12
    2
    2022-12-12
    2023-12-12
    
    Expected output
    2
    
  3. Example 3

    Input
    2022-12-12
    5
    2020-11-11
    2022-07-11
    2022-12-30
    2023-01-01
    2023-01-01
    
    Expected output
    3