시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 512 MB 0 0 0 0.000%

문제

Three points for a win is a common point system used in competitions such as football (soccer) leagues or group tournaments. In this system, a team is awarded 3 points if they win a match, 1 point for a draw, and 0 points if they lose. Finally, the team with the most points wins the league.

Supposed BINUS’ football team joins a league and has played N matches. At the ith match, BINUS’ team scores Ai vs Bi against their opponent. If Ai > Bi, then BINUS’ team wins the ith match; if Ai < Bi, then BINUS’ team loses the match; otherwise, if Ai = Bi, then it’s a draw. Given the score of each match, your task is to determine the total points accumulated by BINUS’ team.

For example, let N = 4 where A1..4 = {3, 0, 2, 4} and B1..4 = {1, 1, 2, 3}.

  • At the first match, BINUS’ team wins by 3 vs 1.
  • At the second match, BINUS’ team loses by 0 vs 1.
  • The third match is a draw (both have the same score of 2).
  • At the fourth match, BINUS’ team wins by 4 vs 3.

Therefore, the total points accumulated by BINUS’ team in this example is: 3 + 0 + 1 + 3 = 7.

입력

Input begins with a line containing an integer: N (1 ≤ N ≤ 100) representing the number of matches. The next line contains N integers: Ai (0 ≤ Ai ≤ 10) representing the score of BINUS’ team. The next line contains N integers: Bi (0 ≤ Bi ≤ 10) representing the score of BINUS’ opponent team.

출력

Output in a line an integer representing the total points accumulated by BINUS’ team.

예제 입력 1

4
3 0 2 4
1 1 2 3

예제 출력 1

7

This is the example from the problem description.

예제 입력 2

2
3 3
4 3

예제 출력 2

1

BINUS loses the first match and has a draw on the second match, thus, the total point is 0 + 1 = 1.

예제 입력 3

6
5 5 5 5 5 5
1 6 5 3 7 0

예제 출력 3

10