If I have a Swoobat with the Simple ability, and it has used Calm Mind twice, does the increase in base power of Stored Power negate the special attack boost?

[Base + n(boosts)x20] + STAB

20 + 8(20) + STAB

180 x 1.5

270

or

[Base + n(boosts)x20] x (2+n(SpA boosts)/2) + STAB

[20 + 8(20)]x(6/2) + STAB

180 x 3 + STAB

540 x 1.5

810

One of these should be right, and I'm really hoping it's the latter.