#!/usr/bin/env python
# -*- coding:utf-8 -*-
import time
import sys
start = time.clock()
a=map(int, raw_input().split())
b=map(int, raw_input().split())
j=k=0
for i in range(4):
    if b[i]==a[i]:
        j+=i
    elif b[i] in a:
        k+=1
print j,k