using System;
using System.Collections.Generic;
using System.Linq;

namespace AOJ
{
  class Problem0025
  {
    static void Main()
    {
      foreach (var nums in ReadNumbers())
      {
        var hit = 0;
        var blow = 0;
        foreach (var i in Enumerable.Range(0, nums[0].Count))
        {
          if (nums[1][i] == nums[0][i])
            ++hit;
          if (nums[0].Contains(nums[1][i]))
            ++blow;
        }
        blow -= hit;
        Console.WriteLine("{0} {1}", hit, blow);
      }
    }

    static IEnumerable<IList<int>[]> ReadNumbers()
    {
      while (true)
      {
        var line = Console.ReadLine();
        if (line == null)
          yield break;
        var p1 = line.Split(' ').Select(s => int.Parse(s)).ToList();
        line = Console.ReadLine();
        var p2 = line.Split(' ').Select(s => int.Parse(s)).ToList();
        yield return new[] {p1, p2};
      }
    }
  }
}