Purifying company shares where the company contributes?

Assalamu alaykum wa-rahmutAllah wa-barakatuhu!

I posted on islam.stackexchange.com and Reddit as well, but I’m very keen to get an answer before the end of Ramadan insha’Allah

The company I work for provides me with shares in its parent company, where I have a minimum amount I have to ‘purchase’ every year before income tax and then the company I work for also contribute on top of that.

I can only sell them after 5 years of having purchased them. I’ve worked there for ~10 years, so I have 5 years worth of stocks I can sell.

Let’s say I had to buy two lots of shares a year, and the company bought one lot on my behalf every year. Now the 5 years worth of shares (3×5) are worth £1500 (the company shares website says I’ve made £1000, and some amount is from company contribution).

When I look up the parent companies shares on a stock screening website the parent company is listed as Haram, so I know I need to either donate all of my available stocks or somehow purify them?

I’ve done a little research, and I’m sure I’ve read that you need to take into account the amount you bought the stocks for when purifying. But not only do I not know what the stocks were worth 10 years ago I don’t know how to account for my company’s contribution.

How do I go about purifying these shares (if I don’t need to just donate all of it away)?

Wasalam

May Allah bless you.
The amount you have paid for and the one the amount the company has paid for on your behalf, are both halal.
If you are taking dividends or, if you will sell the shares for capital gain later on, then make an estimate of how much you think of haram money there is and donate that amount into charity.

And Allah knows best!