select
  count(*)
from
  (
    select
      b.first_name as driver_first_name,
      b.family_name as driver_family_name
    from
      driver a
      join
      person b
      on a.person_id = b.id
    intersect
    select
      d.first_name as passenger_first_name,
      d.family_name as passenger_family_name
    from
      passenger c
      join
      person d
      on c.person_id = d.id
  ) x;
