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

class AIZU0025{
   public static void Translate(string s, out List<int> b) {
      b=new List<int>();
      string[] ss=s.Split(' ');
      foreach (string s1 in ss) b.Add(int.Parse(s1));
   }
   public static void Main(string[] args) {
      List<int> Target=new List<int>(), Query=new List<int>();
      Queue<string> G=new Queue<string>();
      string s;int hit, blow;
      string[] ss;
      while(true) { 
         s = Console.ReadLine();
         if (string.IsNullOrEmpty(s)) break;
         ss=s.Split(' ');
         foreach (string s1 in ss) Target.Add(int.Parse(s1));
         s = Console.ReadLine();
         ss=s.Split(' ');
         foreach (string s1 in ss) Query.Add(int.Parse(s1));
         hit = Hit(Target,Query);
         blow = Target.Intersect(Query).Count()-hit;
         G.Enqueue(string.Format("{0} {1}",hit,blow));
         Target.Clear();Query.Clear();
      }
      while (G.Count>0) Console.WriteLine(G.Dequeue());
   }
   public static int Hit(List<int> Target,List<int> Query) {
      int res = 0;
      for (int i = 0; i<4; i++)
         if (Target[i]==Query[i]) 
            res++;
      return res;
   }
}