QOJ.ac

QOJ

حد الوقت: 1 s حد الذاكرة: 256 MB

#23219. 10부제

الإحصائيات

Under a traffic restriction, a vehicle cannot be driven when the last digit of its registration number equals the last digit of the date. Count how many of five vehicles violate this rule.

For example, a registration ending in $7$ is restricted on days $7$, $17$, and $27$; one ending in $0$ is restricted on days $10$, $20$, and $30$.

Input

The first line contains the last digit of the date. The second line contains the last digits of five vehicle registration numbers. All six numbers are integers from 0 through 9.

Output

Print the number of violating vehicles.

Example 1

Input:

1
1 2 3 4 5

Output:

1

Example 2

Input:

3
1 2 3 5 3

Output:

2

Example 3

Input:

5
1 3 0 7 4

Output:

0

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.