using System;

class AOJ{
  static void Main(string[] args)
  {
    int[] a = new int[4];
    int[] b = new int[4];

    int hit, blow;

    string[] s, t;

    while ((s = Console.ReadLine().Split(' ')) != null){

      t = Console.ReadLine().Split(' ');

      for (int i = 0; i < 4; i++){
        a[i] = int.Parse(s[i]);
        b[i] = int.Parse(t[i]);
      }

      hit = 0;
      blow = 0;

      for (int i = 0; i < 4; i++){
        if (a[i] == b[i])
          hit++;
        for (int j = 0; j < 4; j++){
          if (a[i] == b[j])
            blow++;
        }
      }

      blow -= hit;

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