Mastering Mastermind

Given a secret code and a guess of colored pegs, count exact position matches and remaining color-only matches.

Easy3ArrayStringInterviewNo attempts yetTime limit1sMemory limit256 MB

Problem

Mastermind is a code breaking game for two players. The code maker lays out a row of nn coloured pegs as the code and hides it from the other player. The same colour may be used more than once.

The code breaker tries to work out the code by making guesses, each of them a row of nn coloured pegs. After every guess the code maker reports two numbers rr and ss.

  • rr is the number of pegs that match in both colour and position.
  • ss is the number of the remaining pegs that match in colour but sit in a different position.

Once a peg of the code has been paired with a peg of the guess, neither of them can be paired again. For example, if the code is BACC and the guess is CABB, the A in the second position matches in colour and position, so rr is 1. Among the other three positions only one B and one C match in colour, so ss is 2. The guess holds two B pegs while the code holds one, so only one of them is paired.

Given a code and a guess, compute rr and ss.

Input

One line holds the length of the code nn (1n501 \le n \le 50), the code, and the guess, separated by spaces. The code and the guess are strings of length nn made of upper-case letters.

Output

Print rr and ss on one line, separated by a single space.