CREATE TABLE table_name_40 (laps INT, time_retired VARCHAR, grid VARCHAR)

In grid 15, how many laps were there before ending with a time of exhaust?
SELECT SUM(laps) FROM table_name_40 WHERE time_retired = "exhaust" AND grid < 15
SELECT SUM("laps") FROM "table_name_40" WHERE "exhaust" = "time_retired" AND "grid" < 15