CREATE TABLE table_58489 ("Nation" TEXT, "Gold" FLOAT, "Silver" FLOAT, "Bronze" FLOAT, "Total" FLOAT)

What is the highest bronze for San Marino with less than 82 total and less than 3 golds?
SELECT MAX("Bronze") FROM table_58489 WHERE "Total" < '82' AND "Nation" = 'san marino' AND "Gold" < '3'
SELECT MAX("Bronze") FROM "table_58489" WHERE "Gold" < '3' AND "Nation" = 'san marino' AND "Total" < '82'