P8752 [Lanqiao Cup 2021 NOI Qualifier B2] Special Year
Description
This year is 2021. The number 2021 is very special: its thousands digit equals its tens digit, and its ones digit is greater than its hundreds digit by $1$. We call a year that satisfies these conditions a special year.
Given $5$ years, please calculate how many of them are special years.
Input Format
Input consists of $5$ lines. Each line contains a $4$-digit decimal number (ranging from $1000$ to $9999$), representing a year.
Output Format
Output an integer, representing how many of the $5$ input years are special years.
Explanation/Hint
**Sample Explanation.**
2021 and 9899 are special years. The others are not special years.
Lanqiao Cup 2021, second round provincial contest, Group B, Problem F.
Translated by ChatGPT 5