#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys
import math

tf = True
for s in sys.stdin:
  if tf:
    a = map(int,s.split())
    tf = False
    continue
  else:
    b = map(int,s.split())
    tf = True
  print sum([ 1 for i in range(4) if a[i]==b[i] ]),
  print sum([ 1 for i in range(4) for j in range(4) if i != j and a[i] == b[j] ])