This page is still under construction.

Parts of this page are still being built. What you see may change.

Match Results

Time limit1sMemory limit256 MB

Summary
Read N rounds of scores for A and B, and report how many rounds each player won.
Level

Easy1 of 10

Topics
Implementation, Simulation
Solved
No attempts yet

Problem

A and B play a game consisting of NN rounds. In each round, whoever scores more points wins that round. That is, in the ii-th round, if A's score is greater than B's score, A wins; if B's score is greater than A's score, B wins. If the two scores are equal, the round is a tie and nobody wins.

Given A's and B's scores in each of the NN rounds, write a program that prints the number of rounds A won and the number of rounds B won.

Input

The first line contains an integer NN (1≤N≤1,000,0001 \le N \le 1{,}000{,}000).

Each of the next NN lines contains two integers AiA_i and BiB_i (0≤Ai,Bi≤1000 \le A_i, B_i \le 100), the scores in that round, separated by a space.

Output

On the first line, print the number of rounds A won and the number of rounds B won, in that order, separated by a space.

Examples2

  1. Example 1

    Input
    4
    100 0
    5 6
    40 50
    74 75
    
    Expected output
    1 3
    
  2. Example 2

    Input
    5
    20 20
    3 95
    60 59
    40 40
    20 19
    
    Expected output
    2 1