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

namespace AOJ.Volume0
{
    class Program0025
    {
        static void Main(string[] args)
        {
            string line;
            var inputs = new Queue<string[]>();

            while ((line = Console.ReadLine()) != null)
            {
                inputs.Enqueue(new[] { line, Console.ReadLine() });
            }

            foreach (var input in inputs)
            {
                int hit, blow;            

                char[] a = input[0].Split(' ').Select(s => Convert.ToChar(s)).ToArray();
                char[] b = input[1].Split(' ').Select(s => Convert.ToChar(s)).ToArray();

                hit = Enumerable.Range(0, 4).Count(i => a[i] == b[i]);
                blow = a.Intersect(b).Count() - hit;

                Console.WriteLine("{0} {1}", hit, blow);
            }
        }
    }
}