Counter target spell unless its controller pays

for each card in your graveyard.
Madness

(If you discard this card, discard it into exile. When you do, cast it for its madness cost or put it into your graveyard.)
Count the number of cards in your graveyard as Circular Logic resolves to determine how much the controller of the target spell has to pay. Circular Logic is still on the stack at that time. It doesn't count itself.