SAC '22 Code Challenge 5 Junior P2 - Badminton Scoring

View as PDF

Submit solution


Points: 3
Time limit: 1.0s
Memory limit: 256M

Author:
Problem types

After winning his Fortnite game, Mr. DeMello decided to play N badminton games.

Each of these games has a score for Mr. DeMello, M_i, and a score for his opponent, O_i.

Mr. DeMello wins a game if he has strictly more points than his opponent.

Can you tell DeMello how many of the N games he won?

Constraints

1 \le N \le 10^5

0 \le M_i, O_i \le 21

Input Specification

The first line will contain an integer, N, the number of games.

The next N lines will contain two integers, M_i and O_i, the scores for the i^\text{th} game.

Output Specification

Output the number of games Mr. DeMello won.

Sample Input

6
0 0
1 0
21 21
20 21
5 3
16 3

Sample Output

3

Explanation for Sample Output

Mr. DeMello only wins 3 games: the second one (1 to 0), the fifth one (5 to 3), and the sixth one (16 to 3).


Comments

There are no comments at the moment.