let h()=Scanf.scanf"%d %d %d %d\n"(fun a b c d->[a;b;c;d]);;
let rec f()=
  let a,b=h(),h()in
  let n=List.fold_left2(fun z x y->if x=y then z+1 else z)0 a b in
  Printf.printf"%d %d\n" n ((List.fold_left(fun z e->if List.mem e b then z+1 else z)0 a)-n);
  f()
;;try f()with _->()