#t497. 统计满足条件的4位数个数

统计满足条件的4位数个数

Counting Four-digit Numbers Satisfying a Condition

Problem Description

Given several four-digit numbers, count how many of them satisfy the following condition:

subtract the digit in the thousands place, then the digit in the hundreds place, then the digit in the tens place from the digit in the ones place, and the result is greater than zero.

Input Format

The input has two lines. The first line is the number nn of four-digit numbers; the second line holds the nn four-digit numbers separated by spaces. (n≤100)(n \le 100).

Output Format

One line: an integer, the number of four-digit numbers satisfying the condition.

Sample Input

5
1234 1349 6119 2123 5017

Sample Output

3