Lenny has 20 x 5 = <<20*5=100>>100 pens.
She gave her close friends 100 x 40% = <<100*40*.01=40>>40 pens.
So, 100 - 40 = <<100-40=60>>60 pens were left.
Half of 60 is 60/4= <<60/4=15>>15 pens.
Thus, Lenny has 60 - 15 = <<60-15=45>>45 pens left.
#### 45