How many grids does Ducati have with Casey Stoner as a rider with fewer than 27 laps?
CREATE TABLE "moto_gp_classification" (
  "rider" text,
  "manufacturer" text,
  "laps" real,
  "time" text,
  "grid" real
);
SELECT COUNT("grid") FROM "moto_gp_classification" WHERE "manufacturer"='ducati' AND "rider"='casey stoner' AND "laps"<27;