Medical premium deduction for self employment income

I understand that you can deduct medical premiums from your self employment income.  I have an ACA plan that is subsidized.   Can I deduct the entire non-subsidized premium I paid to the ACA plan from my self employment income Of course the non-subsidized premium I paid is based on my total income for the year (including  self employment income, dividend income, and pension income).  Had I not had dividend and pension income the subsidized premium would have been larger and the non-subsidized premium smaller