what was the total hospital cost of patient 19040 on their first hospital visit?
select sum(cost.cost) from cost where cost.hadm_id in ( select admissions.hadm_id from admissions where admissions.subject_id = 19040 and admissions.dischtime is not null order by admissions.admittime asc limit 1 )