score:1
There is no hard and fast rule regarding this; however, if trying to re-enter the US shortly after a long visit, the CBP officer is likely to assume you're trying to live in the US, in which case, unless you can convince him/her otherwise, you'll be summarily refused entry, deported and banned from entering under the VWP again.
Personally, I would wait at least 3 months, and bring solid documentation (letter from the employer, printout of return ticket, a formal invitation from your friend, documentation about the purpose of your previous trips, etc.) since then, you won't have spent more than 50% of the last half-year in the US