Conversion cnc to mis

If I
Buy 10 stocks Lupin in CNC at 1010
Buy 10 more Lupin in cnc at 950
I convert 7 stocks to MIS
What will be considered as cost for MIS?

Lupin 10 shares CNC at 1010 + Lupin 10 shares CNC at 950 = Lupin 20 shares CNC at 980.

If you convert 7 of these shares to MIS, then you will be left with Lupin 13 shares CNC at 980.