Security deposits, generally, are not for broken leases but are for damage to an apartment made by a tenant over and above normal wear and tear.  So technically you can not keep any of it.  The tenant is, however, liable for the lease until its expiration so you did not have to let them out (that was nice of you) or re-rent the apartment (most states do not require that landlords do anything to mitigate their damages).  That was also nice of you.  You are definitely entitled to the half month of rent that you will lose.  As for the rest I would double check with an attorney in your area and BRING THE LEASE AGREEMENT which is binding on all the parties.  Good luck.