import sys
import math


def hit_and_blow(a, b):
    sa = set(a)
    sb = set(b)
    return len(sa.intersection(sb))


def hit(a, b):
    return reduce(hit_number, map((lambda x, y: (x, y)), a, b), 0)


def hit_number(acc, x):
    if x[0] == x[1]:
        return acc + 1
    else:
        return acc


#input_file = open(sys.argv[1], "r")

while True:
    try:
        a = map(int, sys.stdin.readline().split(' '))
        b = map(int, sys.stdin.readline().split(' '))
        hb = hit_and_blow(a, b)
        h = hit(a, b)
        b = hb - h
        print h, b
    except ValueError:
        exit()