text: Below is an context that describes a sql query, paired with an question that provides further information. Write an answer that appropriately completes the request.  # noqa: E501
  ### Context:
  CREATE TABLE table_name_40 (goals_for VARCHAR, played VARCHAR, draws VARCHAR, losses VARCHAR)
  ### Question:
  What is the total number of goals when there are 3 draws, more than 18 losses, and played is smaller than 38?
  ### Answer:
  SELECT COUNT(goals_for) FROM table_name_40 WHERE draws = 3 AND losses > 18 AND played < 38