First create a mail trigger. I have a trigger here that looks from mails from a given address. I aasume you have the same (for security reasons)
Then create a Set Job Variable task that writes subject to var:
You find this variable here:
Now you have this variable stored when mail arrives:
You could have next a stop job task if variables does not contain the desired strings. I am sure there are many ways of proceeding from this point.