let k=[0;1;2;3];;
let h()=Scanf.scanf"%d %d %d %d "(fun a b c d->[a;b;c;d]);;
let rec f()=
  let a,b=h(),h()in
  let g(m,n)s i=
    let z(m,n)x j=
      if x=s then
        if i=j then(m+1,n) else(m,n+1)
      else(m,n)
    in
    List.fold_left2 z(m,n)a k
  in
  let m,n=List.fold_left2 g(0,0)b k in
  f(Printf.printf "%d %d\n"m n);;
try f()with _->()