while True:
    try:
        a= list(map(int,input().split()))
        b= list(map(int, input().split()))
        hit = sum([1 for i in range(4) if a[i] == b[i]])
        blow = sum([1 for i in range(4) for j in range(4) if i != j and a[i] == b[j]])
        print(str(hit) + " " + str(blow))
    except:
        break
