how much has patient 30987 to pay for their hospital stay in the first hospital encounter?
select sum(cost.cost) from cost where cost.hadm_id in ( select admissions.hadm_id from admissions where admissions.subject_id = 30987 and admissions.dischtime is not null order by admissions.admittime asc limit 1 )