Battle Order Score

Time limit1sMemory limit128 MB

Problem

Hyunwoo answered a history test question that asks for several naval battles to be written in chronological order.

The old grading rule compared each position directly with the correct order. Because of that, moving one battle to the wrong end could make an answer receive 0 points even when most pairwise relationships were correct.

The teacher decides to grade the answer again by considering every pair of battles. For each pair, if their relative order in Hyunwoo's answer is the same as their relative order in the correct answer, he earns 1 point. With N battles, there are N(N-1)/2 pairs.

Given the correct order and Hyunwoo's answer, compute Hyunwoo's score.

Input

The first line contains the number of battles N (2 <= N <= 2500).

The next line contains the correct order, separated by spaces. The following line contains Hyunwoo's answer, separated by spaces.

Each battle name consists of 3 to 15 lowercase English letters.

Output

Print Hyunwoo's score in the form a/b. Do not reduce the fraction.