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

class AIZU0025{
   private static void Read(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, Query;
      string s;
      while(true) { 
         s = Console.ReadLine();
         if (string.IsNullOrEmpty(s)) break;
         Read(s,out Target);
         s = Console.ReadLine();
         Read(s,out Query);
         int hit = Hit(Target,Query);
         int blow = Target.Intersect(Query).Count()-hit;
         Console.WriteLine("{0} {1}",hit,blow);
      }
   }

   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;
   }

}