How much can capital loss carryover be used to deduct capital gains?

Suppose in Year 1, I have a long-term capital loss of $10,000. I use the $3,000 to offset my ordinary income in year 1 and carryover the remaining $7,000 to future years.

 

Now suppose in Year 2, I have long-term capital gains of $18,000.

 

My question is: how much of the capital gains in Year 2 can I offset using my capital losses from Year 1?

 

My understanding of capital loss carryover limitation is that the $3,000 limit only applies to ordinary income. Does the same limit apply to capital gains?